This commit is contained in:
Boblet 2024-11-04 16:59:46 +01:00
parent 4e82346c5a
commit e6bbd63267
13 changed files with 98 additions and 87 deletions

View File

@ -47,6 +47,10 @@
* Removed legacy wire items
* Removed random ore, along with its configs
* DFC emitters are now only 95% efficient instead of 98%
* Oily coal has been removed from worldgen, it no longer spawns in new chunks
* Existing oily coal can be mined risk-free
* Reeds rendering into water can now be toggled with the RENDER_REEDS client config
* This option is usually enabled by default, unless Angelica is installed
## Fixed
* The conveyor grabber should no longer skip over items when used in long lines

View File

@ -146,8 +146,8 @@ public class ModBlocks {
public static Block ore_bedrock_oil;
public static Block ore_lignite;
public static Block ore_asbestos;
public static Block ore_coal_oil;
public static Block ore_coal_oil_burning;
@Deprecated public static Block ore_coal_oil;
@Deprecated public static Block ore_coal_oil_burning;
public static Block ore_tikite;
@ -1008,6 +1008,7 @@ public class ModBlocks {
public static Block machine_press;
public static Block machine_epress;
public static Block machine_conveyor_press;
public static Block machine_ammo_press;
public static Block machine_siren;
@ -2179,6 +2180,7 @@ public class ModBlocks {
machine_press = new MachinePress(Material.iron).setBlockName("machine_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_press");
machine_epress = new MachineEPress(Material.iron).setBlockName("machine_epress").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_epress");
machine_conveyor_press = new MachineConveyorPress(Material.iron).setBlockName("machine_conveyor_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
machine_ammo_press = new MachineAmmoPress().setBlockName("machine_ammo_press").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
reactor_research = new ReactorResearch(Material.iron).setBlockName("machine_reactor_small").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_reactor_small");
reactor_zirnox = new ReactorZirnox(Material.iron).setBlockName("machine_zirnox").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
zirnox_destroyed = new ZirnoxDestroyed(Material.iron).setBlockName("zirnox_destroyed").setHardness(100.0F).setResistance(800.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_steel");
@ -2959,6 +2961,7 @@ public class ModBlocks {
GameRegistry.registerBlock(machine_press, machine_press.getUnlocalizedName());
GameRegistry.registerBlock(machine_epress, machine_epress.getUnlocalizedName());
register(machine_conveyor_press);
register(machine_ammo_press);
register(pump_steam);
register(pump_electric);
register(heater_firebox);

View File

@ -3,20 +3,12 @@ package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.tool.ItemToolAbility;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemTool;
import net.minecraft.item.Item.ToolMaterial;
import net.minecraft.util.Vec3;
import net.minecraft.world.Explosion;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class BlockCoalOil extends Block {
@ -24,19 +16,6 @@ public class BlockCoalOil extends Block {
super(mat);
}
@Override
public void onNeighborBlockChange(World world, int x, int y, int z, Block b) {
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
Block n = world.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ);
if(n == ModBlocks.ore_coal_oil_burning || n == ModBlocks.balefire || n == Blocks.fire || n.getMaterial() == Material.lava) {
world.scheduleBlockUpdate(x, y, z, this, world.rand.nextInt(20) + 2);
}
}
}
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
world.setBlock(x, y, z, ModBlocks.ore_coal_oil_burning);
@ -51,58 +30,4 @@ public class BlockCoalOil extends Block {
public int quantityDropped(Random rand) {
return 2 + rand.nextInt(2);
}
public void onBlockHarvested(World world, int x, int y, int z, int meta, EntityPlayer player) {
if(doesToolIgnite(player)) {
if(world.rand.nextInt(10) == 0)
world.setBlock(x, y, z, Blocks.fire);
}
}
public void onBlockClicked(World world, int x, int y, int z, EntityPlayer player) {
if(!world.isRemote)
return;
if(doesToolIgnite(player)) {
Random rand = world.rand;
for(int i = 0; i < 15; i++) {
Vec3 vec = Vec3.createVectorHelper(1, 0, 0);
vec.rotateAroundZ((float)(Math.PI * rand.nextDouble() * 2D));
vec.rotateAroundY((float)(Math.PI * rand.nextDouble() * 2D));
double dX = vec.xCoord;
double dY = vec.yCoord;
double dZ = vec.zCoord;
if(Math.abs(dX) > 1)
dX /= Math.abs(dX);
if(Math.abs(dY) > 1)
dY /= Math.abs(dY);
if(Math.abs(dX) > 1)
dZ /= Math.abs(dZ);
world.spawnParticle("flame", x + 0.5 + dX * 0.75, y + 0.5 + dY * 0.75, z + 0.5 + dZ * 0.75, 0.0, 0.0, 0.0);
}
}
}
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) {
world.setBlock(x, y, z, Blocks.fire);
}
private boolean doesToolIgnite(EntityPlayer player) {
if(player.getHeldItem() == null)
return false;
if(!(player.getHeldItem().getItem() instanceof ItemTool || player.getHeldItem().getItem() instanceof ItemToolAbility))
return false;
ItemTool tool = (ItemTool) player.getHeldItem().getItem();
return tool.func_150913_i() != ToolMaterial.WOOD;
}
}

View File

@ -0,0 +1,36 @@
package com.hbm.blocks.machine;
import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.TileEntityMachineAmmoPress;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
public class MachineAmmoPress extends BlockContainer {
public MachineAmmoPress() {
super(Material.iron);
}
@Override
public TileEntity createNewTileEntity(World world, int meta) {
return new TileEntityMachineAmmoPress();
}
@Override
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z);
return true;
} else {
return false;
}
}
}

View File

@ -15,6 +15,7 @@ import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.main.MainRegistry;
import com.hbm.util.Compat;
// https://youtube.com/shorts/XTHZWqZt_AI
public class ClientConfig {
@ -36,6 +37,7 @@ public class ClientConfig {
public static ConfigWrapper<Boolean> RENDER_CABLE_HANG = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> NUKE_HUD_FLASH = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> NUKE_HUD_SHAKE = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> RENDER_REEDS = new ConfigWrapper(!Compat.isModLoaded(Compat.MOD_ANG));
private static void initDefaults() {
configMap.put("GEIGER_OFFSET_HORIZONTAL", GEIGER_OFFSET_HORIZONTAL);
@ -51,6 +53,7 @@ public class ClientConfig {
configMap.put("RENDER_CABLE_HANG", RENDER_CABLE_HANG);
configMap.put("NUKE_HUD_FLASH", NUKE_HUD_FLASH);
configMap.put("NUKE_HUD_SHAKE", NUKE_HUD_SHAKE);
configMap.put("RENDER_REEDS", RENDER_REEDS);
}
/** Initializes defaults, then reads the config file if it exists, then writes the config file. */

View File

@ -24,7 +24,6 @@ public class WorldConfig {
public static int rareSpawn = 6;
public static int lithiumSpawn = 6;
public static int cinnebarSpawn = 1;
public static int oilcoalSpawn = 128;
public static int gassshaleSpawn = 5;
public static int gasbubbleSpawn = 12;
public static int explosivebubbleSpawn = 0;
@ -141,7 +140,6 @@ public class WorldConfig {
asbestosSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.12_asbestosSpawnRate", "Amount of asbestos ore veins per chunk", 2);
lithiumSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.13_lithiumSpawnRate", "Amount of schist lithium ore veins per chunk", 6);
rareSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.14_rareEarthSpawnRate", "Amount of rare earth ore veins per chunk", 6);
oilcoalSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.15_oilCoalSpawnRate", "Spawns an oily coal vein every nTH chunk", 128);
gassshaleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.16_gasShaleSpawnRate", "Amount of oil shale veins per chunk", 5);
gasbubbleSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.17_gasBubbleSpawnRate", "Spawns a gas bubble every nTH chunk", 12);
cinnebarSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.18_cinnebarSpawnRate", "Amount of cinnebar ore veins per chunk", 1);

View File

@ -107,7 +107,7 @@ public class ItemGunStinger extends ItemGunBaseNT {
Vec3NT toEntity = new Vec3NT(0, 0, 0);
for(Entity entity : entities) {
if(entity.height < 0.5F) continue;
if(entity.height < 0.5F || !entity.canBeCollidedWith()) continue;
toEntity.setComponents(entity.posX - x, entity.posY + entity.height / 2D - y, entity.posZ - z);
double vecProd = toEntity.xCoord * delta.xCoord + toEntity.yCoord * delta.yCoord + toEntity.zCoord * delta.zCoord;

View File

@ -96,9 +96,6 @@ public class HbmWorldGen implements IWorldGenerator {
DungeonToolbox.generateFlowers(world, rand, i, j, ModBlocks.reeds, 0);
}
}
if(WorldConfig.oilcoalSpawn > 0 && rand.nextInt(WorldConfig.oilcoalSpawn) == 0)
DungeonToolbox.generateOre(world, rand, i, j, 1, 64, 32, 32, ModBlocks.ore_coal_oil);
if(WorldConfig.gasbubbleSpawn > 0 && rand.nextInt(WorldConfig.gasbubbleSpawn) == 0)
DungeonToolbox.generateOre(world, rand, i, j, 1, 32, 30, 10, ModBlocks.gas_flammable, 1);

View File

@ -1,6 +1,7 @@
package com.hbm.render.block;
import com.hbm.blocks.generic.BlockReeds;
import com.hbm.config.ClientConfig;
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
import net.minecraft.block.Block;
@ -27,10 +28,15 @@ public class RenderReeds implements ISimpleBlockRenderingHandler {
tessellator.setColorOpaque_F(r * m, g * m, b * m);
int depth = 0;
for(int i = y - 1; i > 0 ; i--) {
Block water = world.getBlock(x, i, z);
depth = y - i;
if(water != Blocks.water && water != Blocks.flowing_water) break;
if(!ClientConfig.RENDER_REEDS.get()) {
depth = 1;
} else {
for(int i = y - 1; i > 0 ; i--) {
Block water = world.getBlock(x, i, z);
depth = y - i;
if(water != Blocks.water && water != Blocks.flowing_water) break;
}
}
BlockReeds reeds = (BlockReeds) block;

View File

@ -0,0 +1,38 @@
package com.hbm.tileentity.machine;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.world.World;
public class TileEntityMachineAmmoPress extends TileEntityMachineBase implements IGUIProvider {
public TileEntityMachineAmmoPress() {
super(10);
}
@Override
public String getName() {
return "container.machineAmmoPress";
}
@Override
public void updateEntity() {
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
@Override
@SideOnly(Side.CLIENT)
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return null;
}
}

View File

@ -37,6 +37,7 @@ public class Compat {
public static final String MOD_RC = "Railcraft";
public static final String MOD_TC = "tc";
public static final String MOD_EIDS = "endlessids";
public static final String MOD_ANG = "angelica";
public static Item tryLoadItem(String domain, String name) {
return (Item) Item.itemRegistry.getObject(getReg(domain, name));

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 264 B