Skip to content

Commit

Permalink
flixes
Browse files Browse the repository at this point in the history
  • Loading branch information
HbmMods committed Jul 15, 2024
1 parent 7896c04 commit f8465b5
Show file tree
Hide file tree
Showing 15 changed files with 79 additions and 156 deletions.
35 changes: 5 additions & 30 deletions changelog
Original file line number Diff line number Diff line change
@@ -1,33 +1,8 @@
## Added
* Powered Floodlight
* Uses 100HE/t to create light
* Casts 15 rays in a wide beam with a maximum length of 64 blocks, each beam creates a spot with light level 15
* Floodlight can be mounted on any side and angled in any direction, angles snap to 5° increments
* Angles can be adjusted after placing with a screwdriver

## Changed
* Changed bedrock ore processing time in the electrolyzer to 60 ticks
* RF converters have been reworked
* The conversion ratio from HE to RF is now 5:1 (instead of 1:4), HE is no longer way more powerful (in order to compensate for the much higher HE output starting with the first generators and becoming increasingly absurd with nuclear power)
* Converters have an internal buffer again, effectively limiting throughput. The internal buffer is 1MRF and 5MHE.
* The input energy buffer has a loss of 5% of its (unused) current level per tick, which means chaining up converters can not be abused to create earlygame super capacitors
* The loss only takes effect once the input buffer can no longer empty into the output buffer, i.e. when energy demand is too low for the input
* The buffer also fixes a bug where the HE to RF converter often behaves weirdly with certain mods, either outright destroying energy ot creating infinite energy
* HE to RF converters now by default have the connection priority of LOW, only feeding into RF networks when all other energy consumers are sufficiently supplied. This can still be changed by using diodes
* Converters now have configurable conversion rates as well as input decay per tick
* The SILEX is now fully deterministic
* Output is no longer random, instead there is now a "recipe index" which is incremented after each operation, choosing a new next output
* This means that the order of outputs for any given input is fixed, and outputs are guaranteed to happen based on the recipe's total weight (most recipes have a total output weight of 100 for simplicity's sake, meaning after 100 operations the output pattern repeats, and all outputs are guaranteed to be picked)
* Simplified the assembler recipes for the SILEX, FEL and all energy storage blocks (no more random wires and single ingots, fewer duplicate materials)
* Turrets will now only lock onto missiles if they are descending (i.e. negative Y speed), which means that launching a missile close to a turret will not cause the turret to immediately shoot it
* The fusion reactor's byproducts are now created by delay and not by chance, making the output predictable
* Tritium-based fusion fuels now have a higher byproduct output rate (900 ticks instead of 1200)
* Automatic crafting tables will no longer accept stacks with a stack size higher than 1 via automation, items will still accumulate and form stacks inside the crafting table, however inserters/hoppers may not transfer larger stacks in a single operation
* This ensures that the items get spread out as intended instead of the inserter just placing the entire stack into one slot and then leaving the other slots empty

## Fixed
* Fixed issue where the NEI universal handler can not correctly display more than 4 outputs (now supports up to 8, which should cover all possible electrolyzer cases too)
* Fixed the metal electrolysis duration variable not being part of the config
* Removed the global energy transfer cap (only per-machine caps apply now), fixing issues where FENSUs in buffer mode would not charge past 10THE, and constantly void energy if above that threshold
* Fixed a bug where the power transfer would sometimes have leftovers due to rounding errors which are send but not used up, effectively creating small amounts of energy out of nothing
* Fixed ZIRNOX space checks omitting the top portion
* Fixed RBMK flames and mini nuke flashes being affected by fog, turning them into glowing squares when viewed at a distance
* Fixed crash caused by brimstone mines being launched from dispensers
* Fixed crash caused by null entries in the furnace recipe list being picked up by the arc furnace
* Fixed crash caused by the automatic crafting table's input when pattern slots are empty
* Fixed crash caused by the automatic crafting table's output (pattern info was accessed OOB)
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=5026
mod_build_number=5027

credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/hbm/inventory/RecipesCommon.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,11 @@ public static class ComparableStack extends AStack {
public int meta;

public ComparableStack(ItemStack stack) {
if(stack == null) {
this.item = ModItems.nothing;
this.stacksize = 1;
return;
}
this.item = stack.getItem();
this.stacksize = stack.stackSize;
this.meta = stack.getItemDamage();
Expand Down
16 changes: 9 additions & 7 deletions src/main/java/com/hbm/inventory/recipes/ArcFurnaceRecipes.java
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,15 @@ public void registerDefaults() {
ItemStack input = (ItemStack) entry.getKey();
ItemStack output = (ItemStack) entry.getValue();

ComparableStack comp = new ComparableStack(input);
if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) {
ArcFurnaceRecipe recipe = recipes.get(comp);
if(recipe == null) recipe = new ArcFurnaceRecipe();
if(recipe.solidOutput == null) {
recipe.solid(output.copy());
recipes.put(comp, recipe);
if(input != null && output != null) {
ComparableStack comp = new ComparableStack(input);
if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) {
ArcFurnaceRecipe recipe = recipes.get(comp);
if(recipe == null) recipe = new ArcFurnaceRecipe();
if(recipe.solidOutput == null) {
recipe.solid(output.copy());
recipes.put(comp, recipe);
}
}
}
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/com/hbm/items/tool/ItemWandD.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
import java.util.List;

import com.hbm.lib.Library;
import com.hbm.world.dungeon.Silo;
import com.hbm.world.gen.component.Component;
import com.hbm.world.gen.component.CivilianFeatures.RuralHouse1;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraft.world.gen.structure.StructureBoundingBox;

public class ItemWandD extends Item {

Expand All @@ -33,13 +35,13 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla

//PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15);

/*int i = pos.blockX >> 4;
int i = pos.blockX >> 4;
int j = pos.blockZ >> 4;

i = (i << 4) + 8;
j = (j << 4) + 8;
Component comp = new RuralHouse1(world.rand, i, j);
comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));*/
comp.addComponentParts(world, world.rand, new StructureBoundingBox(i, j, i + 32, j + 32));

/*TimeAnalyzer.startCount("setBlock");
world.setBlock(pos.blockX, pos.blockY, pos.blockZ, Blocks.dirt);
Expand Down Expand Up @@ -77,8 +79,6 @@ public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer pla
EntityNukeTorex.statFac(world, pos.blockX, pos.blockY + 1, pos.blockZ, 150);
}*/

new Silo().generate(world, world.rand, pos.blockX, pos.blockY + 1, pos.blockZ);

/*EntityTracker entitytracker = ((WorldServer) world).getEntityTracker();
IntHashMap map = ReflectionHelper.getPrivateValue(EntityTracker.class, entitytracker, "trackedEntityIDs", "field_72794_c");
EntityTrackerEntry entry = (EntityTrackerEntry) map.lookup(torex.getEntityId());
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 (5026)";
public static final String VERSION = "1.0.27 BETA (5027)";
//HBM's Beta Naming Convention:
//V T (X)
//V -> next release version
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/hbm/tileentity/IControlReceiverFilter.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.hbm.tileentity;

import com.hbm.interfaces.IControlReceiver;

import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;

public interface IControlReceiverFilter extends IControlReceiver {

void nextMode(int i);

@Override
public default void receiveControl(NBTTagCompound data) {
if(data.hasKey("slot")) {
setFilterContents(data);
}
}

/**
* Expects the implementor to be a tile entity and an IInventory
* @param nbt
*/
public default void setFilterContents(NBTTagCompound nbt) {
TileEntity tile = (TileEntity) this;
IInventory inv = (IInventory) this;
int slot = nbt.getInteger("slot");
inv.setInventorySlotContents(slot, new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
nextMode(slot);
tile.getWorldObj().markTileEntityChunkModified(tile.xCoord, tile.yCoord, tile.zCoord, tile);
}
}
17 changes: 0 additions & 17 deletions src/main/java/com/hbm/tileentity/IFilterable.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
import com.hbm.inventory.gui.GUIAutocrafter;
import com.hbm.lib.Library;
import com.hbm.module.ModulePatternMatcher;
import com.hbm.tileentity.IFilterable;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.BufferUtil;
import com.hbm.util.ItemStackUtil;

import api.hbm.energymk2.IEnergyReceiverMK2;
import cpw.mods.fml.relauncher.Side;
Expand All @@ -22,7 +20,6 @@
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.CraftingManager;
import net.minecraft.item.crafting.IRecipe;
Expand All @@ -31,7 +28,7 @@
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class TileEntityMachineAutocrafter extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IFilterable {
public class TileEntityMachineAutocrafter extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IControlReceiverFilter {


public List<IRecipe> recipes = new ArrayList();
Expand Down Expand Up @@ -188,10 +185,8 @@ public boolean canExtractItem(int i, ItemStack stack, int j) {

if(i > 9 && i < 19) {
ItemStack filter = slots[i - 10];

if(filter == null) return true;

return !matcher.isValidForFilter(filter, i, stack);
return !matcher.isValidForFilter(filter, i - 10, stack);
}

return false;
Expand All @@ -200,8 +195,8 @@ public boolean canExtractItem(int i, ItemStack stack, int j) {
@Override
public boolean isItemValidForSlot(int slot, ItemStack stack) {

//automatically prohibit any stacked item with a container
if(stack.stackSize > 1 && stack.getItem().hasContainerItem(stack))
//automatically prohibit any stacked item, items can only be added one by one
if(stack.stackSize > 1)
return false;

//only allow insertion for the nine recipe slots
Expand All @@ -216,6 +211,7 @@ public boolean isItemValidForSlot(int slot, ItemStack stack) {
List<Integer> validSlots = new ArrayList();
for(int i = 0; i < 9; i++) {
ItemStack filter = slots[i];
if(filter == null) return true;

if(matcher.isValidForFilter(filter, i, stack)) {
validSlots.add(i + 10);
Expand Down Expand Up @@ -346,13 +342,4 @@ public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int
public boolean hasPermission(EntityPlayer player) {
return Vec3.createVectorHelper(xCoord - player.posX, yCoord - player.posY, zCoord - player.posZ).lengthVector() < 20;
}
@Override
public void setFilterContents(NBTTagCompound nbt) {
int slot = nbt.getInteger("slot");
setInventorySlotContents(
slot,
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
nextMode(slot);
markChanged();
}
}
Original file line number Diff line number Diff line change
@@ -1,24 +1,22 @@
package com.hbm.tileentity.machine.storage;

import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.container.ContainerMassStorage;
import com.hbm.inventory.gui.GUIMassStorage;
import com.hbm.items.ModItems;
import com.hbm.tileentity.IFilterable;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.INBTPacketReceiver;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;

public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IFilterable {
public class TileEntityMassStorage extends TileEntityCrateBase implements INBTPacketReceiver, IControlReceiverFilter {

private int stack = 0;
public boolean output = false;
Expand Down Expand Up @@ -165,6 +163,7 @@ public void nextMode(int i) {

@Override
public void receiveControl(NBTTagCompound data) {

if(data.hasKey("provide") && slots[1] != null) {

if(this.getStockpile() == 0) {
Expand Down Expand Up @@ -197,16 +196,6 @@ public void receiveControl(NBTTagCompound data) {
}
}

@Override
public void setFilterContents(NBTTagCompound nbt) {
int slot = nbt.getInteger("slot");
setInventorySlotContents(
slot,
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
nextMode(slot);
markDirty();
}

@Override
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
return !this.isLocked() && i == 0 && (this.getType() == null || (getType().isItemEqual(itemStack) && ItemStack.areItemStackTagsEqual(itemStack, getType())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.hbm.inventory.gui.GUICraneExtractor;
import com.hbm.items.ModItems;
import com.hbm.module.ModulePatternMatcher;
import com.hbm.tileentity.IFilterable;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.IGUIProvider;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand All @@ -18,7 +18,6 @@
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
Expand All @@ -27,7 +26,7 @@
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiver, IFilterable {
public class TileEntityCraneExtractor extends TileEntityCraneBase implements IGUIProvider, IControlReceiver, IControlReceiverFilter {

public boolean isWhitelist = false;
public ModulePatternMatcher matcher;
Expand Down Expand Up @@ -257,13 +256,4 @@ public void receiveControl(NBTTagCompound data) {
setFilterContents(data);
}
}
@Override
public void setFilterContents(NBTTagCompound nbt) {
int slot = nbt.getInteger("slot");
setInventorySlotContents(
slot,
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
nextMode(slot);
markChanged();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import com.hbm.inventory.gui.GUICraneGrabber;
import com.hbm.items.ModItems;
import com.hbm.module.ModulePatternMatcher;
import com.hbm.tileentity.IFilterable;
import com.hbm.tileentity.IControlReceiverFilter;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.util.InventoryUtil;

Expand All @@ -19,7 +19,6 @@
import net.minecraft.inventory.Container;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
Expand All @@ -30,7 +29,7 @@

import java.util.List;

public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIProvider, IFilterable {
public class TileEntityCraneGrabber extends TileEntityCraneBase implements IGUIProvider, IControlReceiverFilter {

public boolean isWhitelist = false;
public ModulePatternMatcher matcher;
Expand Down Expand Up @@ -200,13 +199,4 @@ public void receiveControl(NBTTagCompound data) {
setFilterContents(data);
}
}
@Override
public void setFilterContents(NBTTagCompound nbt) {
int slot = nbt.getInteger("slot");
setInventorySlotContents(
slot,
new ItemStack(Item.getItemById(nbt.getInteger("id")), 1, nbt.getInteger("meta")));
nextMode(slot);
markChanged();
}
}
Loading

0 comments on commit f8465b5

Please sign in to comment.