This commit is contained in:
Bob 2023-07-06 20:48:25 +02:00
parent e78406f64f
commit bc8dfcaa99
8 changed files with 130 additions and 8 deletions

View File

@ -9,6 +9,12 @@
* This allows for more precise control over things like assembler chests, like turning off the ejector for an item that is already full but not other ejectors
* This property makes automating things with multiple inputs a lot easier
* Due to the ore dictionary ability of the counter, buffered items can precisely match the requirements of the recipe
* Particle collider cooling unit
* A block that can replace coils in a particle collider
* Will increment a new "cooling" value which depletes over time and makes coils more effective
* Overcooling causes a penalty, so coolers cannot be spammed and need to be carefully spaced out
* Allows for even more compact particle accelerator setups
* Comes in two tiers, both tiers use a different cooling variable with different effectiveness, the higher tier will override the lower tier if both tiers of coolers are present
## Changed
* The regular boiler now only holds 16k instead of 64k (which is still a lot)

View File

@ -742,6 +742,7 @@ public class ModBlocks {
public static Block hadron_analysis_glass;
public static Block hadron_access;
public static Block hadron_core;
public static Block hadron_cooler;
public static Block machine_electric_furnace_off;
public static Block machine_electric_furnace_on;
@ -1875,6 +1876,7 @@ public class ModBlocks {
hadron_analysis_glass = new BlockNTMGlass(0, RefStrings.MODID + ":hadron_analysis_glass", Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_analysis_glass").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_analysis_glass");
hadron_access = new BlockHadronAccess(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_access").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_access");
hadron_core = new BlockHadronCore(Material.iron).setStepSound(Block.soundTypeMetal).setBlockName("hadron_core").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":hadron_core");
hadron_cooler = new BlockHadronCooler(Material.iron).setBlockName("hadron_cooler").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
machine_electric_furnace_off = new MachineElectricFurnace(false).setBlockName("machine_electric_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
machine_electric_furnace_on = new MachineElectricFurnace(true).setBlockName("machine_electric_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
@ -3123,6 +3125,7 @@ public class ModBlocks {
GameRegistry.registerBlock(hadron_analysis_glass, hadron_analysis_glass.getUnlocalizedName());
GameRegistry.registerBlock(hadron_access, hadron_access.getUnlocalizedName());
GameRegistry.registerBlock(hadron_core, hadron_core.getUnlocalizedName());
register(hadron_cooler);
GameRegistry.registerBlock(rbmk_rod, rbmk_rod.getUnlocalizedName());
GameRegistry.registerBlock(rbmk_rod_mod, rbmk_rod_mod.getUnlocalizedName());

View File

@ -0,0 +1,68 @@
package com.hbm.blocks.machine;
import java.util.List;
import org.lwjgl.input.Keyboard;
import com.hbm.blocks.BlockMulti;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings;
import com.hbm.util.I18nUtil;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.IIcon;
public class BlockHadronCooler extends BlockMulti implements ITooltipProvider {
private IIcon[] icons = new IIcon[getSubCount()];
public BlockHadronCooler(Material mat) {
super(mat);
}
@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister reg) {
icons[0] = reg.registerIcon(RefStrings.MODID + ":hadron_cooler");
icons[1] = reg.registerIcon(RefStrings.MODID + ":hadron_cooler_mk2");
}
@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int metadata) {
return icons[this.rectify(metadata)];
}
@Override
public int getSubCount() {
return 2;
}
@Override
public String getUnlocalizedName(ItemStack stack) {
int meta = this.rectify(stack.getItemDamage());
if(meta == 1) return this.getUnlocalizedName() + "_mk2";
return this.getUnlocalizedName();
}
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
for(String s : I18nUtil.resolveKeyArray(this.getUnlocalizedName(stack) + ".desc")) list.add(EnumChatFormatting.YELLOW + s);
} else {
list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" +
EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" +
EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC + "> to display more info");
}
}
}

View File

@ -91,7 +91,7 @@ public class GUICounterTorch extends GuiInfoContainer {
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
/*for(int j = 0; j < 3; j++) this.frequency[j].mouseClicked(x, y, i);
for(int j = 0; j < 3; j++) this.frequency[j].mouseClicked(x, y, i);
if(guiLeft + 193 <= x && guiLeft + 193 + 18 > x && guiTop + 8 < y && guiTop + 8 + 18 >= y) {
@ -107,13 +107,13 @@ public class GUICounterTorch extends GuiInfoContainer {
for(int j = 0; j < 3; j++) data.setString("c" + j, this.frequency[j].getText());
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, counter.xCoord, counter.yCoord, counter.zCoord));
}*/
}
}
@Override
protected void drawGuiContainerForegroundLayer(int x, int y) {
String name = I18nUtil.resolveKey(this.counter.getInventoryName());
this.fontRendererObj.drawString(name, 184 / 2 - this.fontRendererObj.getStringWidth(name) / 2, this.guiTop + 6, 4210752);
this.fontRendererObj.drawString(name, 184 / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 16, this.ySize - 96 + 2, 4210752);
}
@ -133,7 +133,7 @@ public class GUICounterTorch extends GuiInfoContainer {
@Override
protected void keyTyped(char c, int i) {
//for(int j = 0; j < 3; j++) if(this.frequency[j].textboxKeyTyped(c, i)) return;
for(int j = 0; j < 3; j++) if(this.frequency[j].textboxKeyTyped(c, i)) return;
super.keyTyped(c, i);
}

View File

@ -322,6 +322,8 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
int charge;
int analysis;
boolean isCheckExempt = false;
int cl0 = 0;
int cl1 = 0;
boolean expired = false;
@ -375,6 +377,34 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
if(charge < 0)
this.expire(EnumHadronState.ERROR_NO_CHARGE);
if(cl0 > 0) cl0--;
if(cl1 > 0) cl1--;
}
public void incrementCharge(Block block, int meta, int coilVal) {
if(block == ModBlocks.hadron_cooler) {
if(meta == 0) cl0 += 10;
if(meta == 1) cl1 += 5;
}
//not the best code ever made but it works, dammit
if(cl1 > 0) {
if(cl1 > 15) {
coilVal *= 0.90;
} else {
coilVal *= 1.25;
}
} else if(cl0 > 0) {
if(cl0 > 10) {
coilVal *= 0.75;
} else {
coilVal *= 1.10;
}
}
this.momentum += coilVal;
}
}
@ -414,7 +444,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
if(block == ModBlocks.hadron_diode)
p.isCheckExempt = true;
if(coilValue(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)) > 0)
if(isValidCoil(worldObj.getBlock(x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ)))
p.isCheckExempt = true;
}
@ -445,6 +475,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
for(int c = z - dZ * 2; c <= z + dZ * 2;c++) {
Block block = worldObj.getBlock(a, b, c);
int meta = worldObj.getBlockMetadata(a, b, c);
/** ignore the center for now */
if(a == x && b == y && c == z) {
@ -479,11 +510,11 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
int coilVal = coilValue(block);
//not a valid coil: kablam!
if(coilVal == 0) {
if(!isValidCoil(block)) {
p.expire(EnumHadronState.ERROR_EXPECTED_COIL);
} else {
p.momentum += coilVal;
p.charge -= coilVal;
p.incrementCharge(block, meta, coilVal);
}
continue;
@ -641,7 +672,7 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
return;
//so, the next block is most certainly a wall. not good. perhaps we could try turning?
if(coilValue(next) > 0) {
if(isValidCoil(next)) {
ForgeDirection validDir = ForgeDirection.UNKNOWN;
@ -692,6 +723,14 @@ public class TileEntityHadron extends TileEntityMachineBase implements IEnergyUs
return dirs;
}
public boolean isValidCoil(Block b) {
if(coilValue(b) > 0) return true;
if(b == ModBlocks.hadron_cooler) return true;
return false;
}
public int coilValue(Block b) {
if(b instanceof BlockHadronCoil)

View File

@ -3884,6 +3884,8 @@ tile.hadron_coil_neodymium.name=Dichte Neodymspule
tile.hadron_coil_schrabidate.name=Dichte Schrabidatspule
tile.hadron_coil_schrabidium.name=Dichte Schrabidiumspule
tile.hadron_coil_starmetal.name=Dichte Sternenmetallspule
tile.hadron_cooler.name=Teilchenbeschleuniger-Kühlungseinheit
tile.hadron_cooler_mk2.nameTeilchenbeschleuniger-Kühlungseinheit - Das Palindrome-Spezial
tile.hadron_core.name=Teilchenbeschleuniger-Kernkomponente
tile.hadron_diode.name=Schottky-Partikeldiode
tile.hadron_plating.name=Teilchenbeschleuniger-Außenwand

View File

@ -4759,6 +4759,10 @@ tile.hadron_coil_neodymium.name=Dense Neodymium Coil
tile.hadron_coil_schrabidate.name=Dense Schrabidate Coil
tile.hadron_coil_schrabidium.name=Dense Schrabidic Coil
tile.hadron_coil_starmetal.name=Dense Starmetal Coil
tile.hadron_cooler.name=Particle Accelerator Cooling Unit
tile.hadron_cooler.desc=Cooling power: 10$Overcooling threshold: 10$Cooling bonus: +10%%$Overcooling penalty: -25%%
tile.hadron_cooler_mk2.name=Particle Accelerator Cooling Unit - The Palindrome Special
tile.hadron_cooler_mk2.desc=Cooling power: 5$Overcooling threshold: 15$Cooling bonus: +25%%$Overcooling penalty: -10%%
tile.hadron_core.name=Particle Accelerator Core Component
tile.hadron_diode.name=Schottky Particle Diode
tile.hadron_plating.name=Particle Accelerator Plating

Binary file not shown.

After

Width:  |  Height:  |  Size: 331 B