Skip to content

Commit

Permalink
toora loora
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed Jul 24, 2023
1 parent 4bc09af commit 33bd961
Show file tree
Hide file tree
Showing 11 changed files with 143 additions and 20 deletions.
29 changes: 21 additions & 8 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
## Added
* Rubber ball
* can be thrown at people
* New chlorine processing chain
* Involves 240 processing steps of washing, electrolyzing, centrifuging and treating chlorocalcite
* Custom machines
* Simple processing multiblocks that can be created via config
* The config found in `hbmConfig/hbmCustomMachines.json` defines the input and output slots, fluid amount, speed and consumption multipliers as well as the multiblock
* The config in `hbmRecipes/hbmCustomMachines.json` defines the recipes for all multiblocks with inputs, outputs base speed and consumption rates
* Currently, custom machine recipes do not show up in NEI, a handler will be added soon
* All recipes are shaped, even the fluid types, this was done to improve performance
* Item inputs have filter slots for automation, this allows the right ingredients to be inserted into the right slot easily. For simple machines, this slot can be left empty so any item can be inserted.
* By default, the standard config creates one custom machine with one recipe called the paper press, turning sawdust and water into paper
* More examples can be found in the configs attached to this github release
* Custom machines can also be configured as generators, using up item and fluid inputs and turning them into energy
* While changing the configs and adding/removing machines in an existing world is possible, this is not recommended because of potential ID shifts of the machines, breaking existing custom machines in the world
* With custom machines, quite a few otherwise unused construction blocks have been added which are recommended to be used for custom machines as they come in tiers, have reasonable cost and mesh well visually with the multiblocks
* However, using them is not mandatory, the only functional block is the port which is most likely needed for automation, although the machine's controller itself also serves as a port

## Changed
* Glyphids now have a higher tracking range, being 256 blocks
* Standard glyphids now have a base health of 100
* Glyphid scouts are now immune to fire and explosive damage, have a 50% damage reduction against projectiles and have passive regeneration
* Increased hive block blast resistance, they can no longer be blown up wiith conventional explosives
* Additional OC compat for fluid gauges
* Crates now display their contents when in item form

## Fixed
* Hopefully fixed an issue where pollution-based mob buffs apply multiple times, resulting in near-unkillable mobs
* Fixed exploit allowing the cap for shield infusions to be bypassed
* Fixed tier detection mode in the radar detecting the Y-position instead of the actual tier
* Fixed missing parenthesis in sigmoid curve's description
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
mod_version=1.0.27
# Empty build number makes a release type
mod_build_number=4663
mod_build_number=4670

credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion algorithms),\
\ Hoboy (textures, models), Doctor17 (russian localization), Drillgon200 (effects, models,\
Expand Down
36 changes: 35 additions & 1 deletion src/main/java/com/hbm/blocks/generic/BlockStorageCrate.java
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package com.hbm.blocks.generic;

import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import com.hbm.blocks.IBlockMulti;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.blocks.ModBlocks;
import com.hbm.items.ModItems;
import com.hbm.items.tool.ItemLock;
Expand Down Expand Up @@ -36,7 +39,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;

public class BlockStorageCrate extends BlockContainer implements IBlockMulti {
public class BlockStorageCrate extends BlockContainer implements IBlockMulti, ITooltipProvider {

@SideOnly(Side.CLIENT)
private IIcon iconTop;
Expand Down Expand Up @@ -282,4 +285,35 @@ public boolean hasComparatorInputOverride() {
public int getComparatorInputOverride(World world, int x, int y, int z, int side) {
return Container.calcRedstoneFromInventory((IInventory) world.getTileEntity(x, y, z));
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
if(stack.hasTagCompound()) {

List<String> contents = new ArrayList();
int amount = 0;

for(int i = 0; i < 100; i++) { //whatever the biggest container is, i can't be bothered to check
ItemStack content = ItemStack.loadItemStackFromNBT(stack.stackTagCompound.getCompoundTag("slot" + i));

if(content != null) {
amount++;

if(contents.size() < 10) {
contents.add(EnumChatFormatting.AQUA + " - " + content.getDisplayName() + (content.stackSize > 1 ? (" x" + content.stackSize) : ""));
}
}
}

if(!contents.isEmpty()) {
list.add(EnumChatFormatting.AQUA + "Contains:");
list.addAll(contents);
amount -= contents.size();

if(amount > 0) {
list.add(EnumChatFormatting.AQUA + "...and " + amount + " more.");
}
}
}
}
}
52 changes: 52 additions & 0 deletions src/main/java/com/hbm/blocks/machine/BlockCustomMachine.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.hbm.blocks.machine;

import java.util.ArrayList;
import java.util.Random;

import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.items.ModItems;
Expand All @@ -11,11 +12,14 @@
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
Expand Down Expand Up @@ -145,4 +149,52 @@ public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, i

return super.getPickBlock(target, world, x, y, z);
}

@Override
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {

ISidedInventory sided = (ISidedInventory) world.getTileEntity(x, y, z);
Random rand = world.rand;

if(sided != null) {
for(int i1 = 0; i1 < sided.getSizeInventory(); ++i1) {

if(i1 >= 10 && i1 <= 15)
continue; // do NOT drop the filters

ItemStack itemstack = sided.getStackInSlot(i1);

if(itemstack != null) {
float f = rand.nextFloat() * 0.8F + 0.1F;
float f1 = rand.nextFloat() * 0.8F + 0.1F;
float f2 = rand.nextFloat() * 0.8F + 0.1F;

while(itemstack.stackSize > 0) {
int j1 = rand.nextInt(21) + 10;

if(j1 > itemstack.stackSize) {
j1 = itemstack.stackSize;
}

itemstack.stackSize -= j1;
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));

if(itemstack.hasTagCompound()) {
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
}

float f3 = 0.05F;
entityitem.motionX = (float) rand.nextGaussian() * f3;
entityitem.motionY = (float) rand.nextGaussian() * f3 + 0.2F;
entityitem.motionZ = (float) rand.nextGaussian() * f3;
world.spawnEntityInWorld(entityitem);
}
}
}

world.func_147453_f(x, y, z, block);
}

super.breakBlock(world, x, y, z, block, meta);
}
}
6 changes: 3 additions & 3 deletions src/main/java/com/hbm/config/CustomMachineConfigJSON.java
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public static void writeDefault(File config) {
for(int x = -1; x <= 1; x++) {
for(int y = -1; y <= 1; y++) {
for(int z = 0; z <= 2; z++) {
if(!(x == 0 && y == 0 && z == 1) && !(x == 0 && z == 1) && !(x == 0 && y == 0 && z == 0)) {
if(!(x == 0 && y == 0 && z == 1) && !(x == 0 && z == 0)) {
writer.beginObject().setIndent("");
writer.name("block").value(y == 0 ? "hbm:tile.cm_sheet" : "hbm:tile.cm_block");
writer.name("x").value(x);
Expand All @@ -109,7 +109,7 @@ public static void writeDefault(File config) {
writer.name("block").value("hbm:tile.cm_port");
writer.name("x").value(0);
writer.name("y").value(-1);
writer.name("z").value(1);
writer.name("z").value(0);
writer.name("metas").beginArray();
writer.value(0);
writer.endArray();
Expand All @@ -119,7 +119,7 @@ public static void writeDefault(File config) {
writer.name("block").value("hbm:tile.cm_port");
writer.name("x").value(0);
writer.name("y").value(1);
writer.name("z").value(1);
writer.name("z").value(0);
writer.name("metas").beginArray();
writer.value(0);
writer.endArray();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/items/machine/ItemRBMKRod.java
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ public String getFuncDescription(ItemStack stack) {
break;
case ARCH: function = "(%1$s - %1$s² / 10000) / 100 * %2$s [0;∞]";
break;
case SIGMOID: function = "%2$s / (1 + e^(-(%1$s - 50) / 10)";
case SIGMOID: function = "%2$s / (1 + e^(-(%1$s - 50) / 10))";
break;
case SQUARE_ROOT: function = "sqrt(%1$s) * %2$s / 10";
break;
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/lib/RefStrings.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
public class RefStrings {
public static final String MODID = "hbm";
public static final String NAME = "Hbm's Nuclear Tech Mod";
public static final String VERSION = "1.0.27 BETA (4663)";
public static final String VERSION = "1.0.27 BETA (4670)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/com/hbm/main/CraftingManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -1096,6 +1096,26 @@ public static void reg2() {
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 1), new ItemStack(ModItems.sliding_blast_door_skin, 1, 0));
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin, 1, 2), new ItemStack(ModItems.sliding_blast_door_skin, 1, 1));
addShapelessAuto(new ItemStack(ModItems.sliding_blast_door_skin), new ItemStack(ModItems.sliding_blast_door_skin, 1, 2));

addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 0), " I ", "IPI", " I ", 'I', STEEL.ingot(), 'P', STEEL.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 1), " I ", "IPI", " I ", 'I', ALLOY.ingot(), 'P', ALLOY.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 2), " I ", "IPI", " I ", 'I', DESH.ingot(), 'P', DESH.plateCast());
addRecipeAuto(new ItemStack(ModBlocks.cm_block, 4, 3), " I ", "IPI", " I ", 'I', ANY_RESISTANTALLOY.ingot(), 'P', ANY_RESISTANTALLOY.plateCast());

for(int i = 0; i < 4; i++) {
addRecipeAuto(new ItemStack(ModBlocks.cm_sheet, 16, i), "BB", "BB", 'B', new ItemStack(ModBlocks.cm_block, 1, i));
addRecipeAuto(new ItemStack(ModBlocks.cm_tank, 4, i), " B ", "BGB", " B ", 'B', new ItemStack(ModBlocks.cm_block, 1, i), 'G', KEY_ANYGLASS);
addRecipeAuto(new ItemStack(ModBlocks.cm_port, 1, i), "P", "B", "P", 'B', new ItemStack(ModBlocks.cm_block, 1, i), 'P', IRON.plate());
}

addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 0), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor);
addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 1), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor_desh);
addRecipeAuto(new ItemStack(ModBlocks.cm_engine, 1, 2), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.motor_bismuth);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 0), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_aluminium);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 1), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_copper);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 2), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_red_copper);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 3), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_gold);
addRecipeAuto(new ItemStack(ModBlocks.cm_circuit, 1, 4), " I ", "IMI", " I ", 'I', STEEL.ingot(), 'M', ModItems.circuit_schrabidium);
}

public static void crumple() {
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/hbm/tileentity/TileEntityProxyBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public TileEntity getTE() {

if(cachedPosition != null) {
TileEntity te = Compat.getTileStandard(worldObj, cachedPosition.getX(), cachedPosition.getY(), cachedPosition.getZ());
if(te != null && te != this) return te;
if(te != null && !(te instanceof TileEntityProxyBase)) return te;
cachedPosition = null;
this.markDirty();
}
Expand All @@ -34,15 +34,15 @@ public TileEntity getTE() {
if(pos != null) {

TileEntity te = Compat.getTileStandard(worldObj, pos[0], pos[1], pos[2]);
if(te != null && te != this) return te;
if(te != null && !(te instanceof TileEntityProxyBase)) return te;
}
}

if(this.getBlockType() instanceof IProxyController) {
IProxyController controller = (IProxyController) this.getBlockType();
TileEntity tile = controller.getCore(worldObj, xCoord, yCoord, zCoord);

if(tile != null && tile != this) return tile;
if(tile != null && !(tile instanceof TileEntityProxyBase)) return tile;
}

return null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration.ComponentDefinition;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.container.ContainerMachineCustom;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
Expand Down Expand Up @@ -465,7 +464,7 @@ public long getPower() {

@Override
public long getMaxPower() {
return this.config != null ? this.getMaxPower() : 1;
return this.config != null ? this.config.maxPower : 1;
}

@Override
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/hbm/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -4526,6 +4526,11 @@ tile.cm_block.alloy.name=Advanced Alloy Machine Casing
tile.cm_block.desh.name=Desh Machine Casing
tile.cm_block.steel.name=Steel Machine Casing
tile.cm_block.tcalloy.name=Technetium Steel Machine Casing
tile.cm_circuit.aluminium.name=Tier 1 Circuit Block
tile.cm_circuit.copper.name=Tier 2 Circuit Block
tile.cm_circuit.gold.name=Tier 4 Circuit Block
tile.cm_circuit.red_copper.name=Tier 3 Circuit Block
tile.cm_circuit.schrabidium.name=Tier 5 Circuit Block
tile.cm_engine.bismuth.name=Bismuth Motor Block
tile.cm_engine.desh.name=Desh Motor Block
tile.cm_engine.standard.name=Motor Block
Expand Down

0 comments on commit 33bd961

Please sign in to comment.