Skip to content

Commit

Permalink
Merge pull request #54 from 70000hp/Main-1.12
Browse files Browse the repository at this point in the history
Main 1.12
  • Loading branch information
70000hp authored Dec 27, 2022
2 parents 14bcdbb + fbf52fc commit dcd89e6
Show file tree
Hide file tree
Showing 60 changed files with 3,529 additions and 351 deletions.
12 changes: 12 additions & 0 deletions src/main/java/api/hbm/tile/IHeatSource.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package api.hbm.tile;

public interface IHeatSource {

public int getHeatStored();

/**
* Removes heat from the system. Implementation has to include the checks preventing the heat from going into the negative.
* @param heat
*/
public void useUpHeat(int heat);
}
19 changes: 18 additions & 1 deletion src/main/java/com/hbm/blocks/BlockDummyable.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
import com.hbm.handler.MultiblockHandlerXR;
import com.hbm.lib.ForgeDirection;
import com.hbm.lib.InventoryHelper;
import com.hbm.main.MainRegistry;


import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
Expand Down Expand Up @@ -194,7 +196,22 @@ public void onBlockPlacedBy(World world, BlockPos pos, IBlockState state, Entity

super.onBlockPlacedBy(world, pos, state, player, itemStack);
}

protected boolean standardOpenBehavior(World world, int x, int y, int z, EntityPlayer player, int id) {

if(world.isRemote) {
return true;
} else if(!player.isSneaking()) {
int[] pos = this.findCore(world, x, y, z);

if(pos == null)
return false;

player.openGui(MainRegistry.instance, id, world, pos[0], pos[1], pos[2]);
return true;
} else {
return true;
}
}
protected ForgeDirection getDirModified(ForgeDirection dir) {
return dir;
}
Expand Down
34 changes: 34 additions & 0 deletions src/main/java/com/hbm/blocks/ITooltipProvider.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.hbm.blocks;

import java.util.List;

import org.lwjgl.input.Keyboard;

import com.hbm.util.I18nUtil;

import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.EnumRarity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.TextFormatting;

public interface ITooltipProvider {

public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext);

@SuppressWarnings("unchecked")
public default void addStandardInfo(ItemStack stack, EntityPlayer player, List list, boolean ext) {

if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
for(String s : I18nUtil.resolveKeyArray(((Block)this).getUnlocalizedName() + ".desc")) list.add(TextFormatting.YELLOW + s);
} else {
list.add(TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC +"Hold <" +
TextFormatting.YELLOW + "" + TextFormatting.ITALIC + "LSHIFT" +
TextFormatting.DARK_GRAY + "" + TextFormatting.ITALIC + "> to display more info");
}
}

public default EnumRarity getRarity(ItemStack stack) {
return EnumRarity.COMMON;
}
}
27 changes: 26 additions & 1 deletion src/main/java/com/hbm/blocks/ModBlocks.java

Large diffs are not rendered by default.

51 changes: 51 additions & 0 deletions src/main/java/com/hbm/blocks/machine/FurnaceSteel.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package com.hbm.blocks.machine;

import java.util.List;

import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityFurnaceSteel;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class FurnaceSteel extends BlockDummyable implements ITooltipProvider {

public FurnaceSteel(Material mat, String s) {
super(Material.IRON, s);
}

@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityFurnaceSteel();
return new TileEntityProxyCombo(true, false, false);
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return standardOpenBehavior(world, pos.getX(), pos.getY(), pos.getZ(), player, 0);
}

@Override
public int[] getDimensions() {
return new int[] {1, 0, 1, 1, 1, 1};
}

@Override
public int getOffset() {
return 1;
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
this.addStandardInfo(stack, player, list, ext);
}
}
54 changes: 54 additions & 0 deletions src/main/java/com/hbm/blocks/machine/HeaterFirebox.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
package com.hbm.blocks.machine;

import java.util.List;

import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.TileEntityHeaterFirebox;

import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;

public class HeaterFirebox extends BlockDummyable implements ITooltipProvider {

public HeaterFirebox(Material mat, String s) {
super(Material.IRON, s);
}

@Override
public TileEntity createNewTileEntity(World world, int meta) {

if(meta >= 12)
return new TileEntityHeaterFirebox();

return new TileEntityProxyCombo(true, false, false);
}

@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
return standardOpenBehavior(world, pos.getX(), pos.getY(), pos.getZ(), player, 0);
}

@Override
public int[] getDimensions() {
return new int[] {0, 0, 1, 1, 1, 1};
}

@Override
public int getOffset() {
return 1;
}

@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
this.addStandardInfo(stack, player, list, ext);
}
}
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/capability/HbmLivingProps.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,15 @@ public static void setDigamma(EntityLivingBase entity, float digamma){
}

public static void incrementDigamma(EntityLivingBase entity, float digamma){
IEntityHbmProps data = getData(entity);
getData(entity);
float dRad = getDigamma(entity) + digamma;

if(dRad > 10)
dRad = 10;
if(dRad < 0)
dRad = 0;

data.setDigamma(dRad);
setDigamma(entity,dRad);
}

/// ASBESTOS ///
Expand Down
14 changes: 7 additions & 7 deletions src/main/java/com/hbm/forgefluid/ModForgeFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -81,17 +81,17 @@ public class ModForgeFluids {
public static Fluid hydrogen = new Fluid("hydrogen", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/hydrogen_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/hydrogen_flowing"), null, Color.WHITE).setTemperature(20);
public static Fluid oxygen = new Fluid("oxygen", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/oxygen_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/oxygen_flowing"), null, Color.WHITE).setTemperature(70);
public static Fluid xenon = new Fluid("xenon", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/xenon_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/xenon_flowing"), null, Color.WHITE).setTemperature(163);
public static Fluid balefire = new Fluid("balefire", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_flowing"), null, Color.WHITE).setTemperature(15000 + 273);
public static Fluid balefire = new Fluid("balefire", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_flowing"), null, Color.WHITE).setTemperature(1500 + 273);

public static Fluid abyssal_fuel = new Fluid("abyssal_fuel", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_flowing"), null, Color.WHITE).setTemperature(15000 + 273);
public static Fluid abyssal_fuel = new Fluid("abyssal_fuel", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/balefire_flowing"), null, Color.WHITE).setTemperature(1500 + 273);

public static Fluid mercury = new Fluid("mercury", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/mercury_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/mercury_flowing"), null, Color.WHITE);

public static Fluid plasma_dt = new Fluid("plasma_dt", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_dt_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_dt_flowing"), null, Color.WHITE).setTemperature(32500 + 273);
public static Fluid plasma_hd = new Fluid("plasma_hd", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_hd_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_hd_flowing"), null, Color.WHITE).setTemperature(25000 + 273);
public static Fluid plasma_ht = new Fluid("plasma_ht", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_ht_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_ht_flowing"), null, Color.WHITE).setTemperature(30000 + 273);
public static Fluid plasma_xm = new Fluid("plasma_xm", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_xm_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_xm_flowing"), null, Color.WHITE).setTemperature(42500 + 273);
public static Fluid plasma_bf = new Fluid("plasma_bf", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_bf_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_bf_flowing"), null, Color.WHITE).setTemperature(85000 + 273);
public static Fluid plasma_dt = new Fluid("plasma_dt", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_dt_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_dt_flowing"), null, Color.WHITE).setTemperature(3250 + 273);
public static Fluid plasma_hd = new Fluid("plasma_hd", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_hd_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_hd_flowing"), null, Color.WHITE).setTemperature(2500 + 273);
public static Fluid plasma_ht = new Fluid("plasma_ht", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_ht_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_ht_flowing"), null, Color.WHITE).setTemperature(3000 + 273);
public static Fluid plasma_xm = new Fluid("plasma_xm", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_xm_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_xm_flowing"), null, Color.WHITE).setTemperature(4250 + 273);
public static Fluid plasma_bf = new Fluid("plasma_bf", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_bf_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/plasma_bf_flowing"), null, Color.WHITE).setTemperature(8500 + 273);

public static Fluid pain = new Fluid("pain", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/pain_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/pain_flowing"), null, Color.WHITE);
public static Fluid wastefluid = new Fluid("wastefluid", new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/wastefluid_still"), new ResourceLocation(RefStrings.MODID, "blocks/forgefluid/wastefluid_flowing"), null, Color.WHITE);
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/hbm/handler/ArmorUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -335,8 +335,8 @@ public static boolean checkForGasMask(EntityPlayer player) {

public static boolean checkForDigamma(EntityPlayer player) {

//if(checkArmor(player, ModItems.fau_helmet, ModItems.fau_plate, ModItems.fau_legs, ModItems.fau_boots))
// return true;
if(checkArmor(player, ModItems.fau_helmet, ModItems.fau_plate, ModItems.fau_legs, ModItems.fau_boots))
return true;

if(player.isPotionActive(HbmPotion.stability))
return true;
Expand Down
40 changes: 39 additions & 1 deletion src/main/java/com/hbm/handler/GuiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.hbm.inventory.control_panel.GuiControlEdit;
import com.hbm.inventory.gui.*;
import com.hbm.items.ModItems;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.bomb.TileEntityBombMulti;
import com.hbm.tileentity.bomb.TileEntityCompactLauncher;
import com.hbm.tileentity.bomb.TileEntityLaunchPad;
Expand Down Expand Up @@ -48,6 +49,7 @@
import com.hbm.tileentity.machine.TileEntityForceField;
import com.hbm.tileentity.machine.TileEntityFusionMultiblock;
import com.hbm.tileentity.machine.TileEntityHadron;
import com.hbm.tileentity.machine.TileEntityHeaterFirebox;
import com.hbm.tileentity.machine.TileEntityITER;
import com.hbm.tileentity.machine.TileEntityMachineArcFurnace;
import com.hbm.tileentity.machine.TileEntityMachineAssembler;
Expand Down Expand Up @@ -125,7 +127,10 @@
import com.hbm.tileentity.turret.TileEntityTurretRichard;
import com.hbm.tileentity.turret.TileEntityTurretTauon;

import net.minecraft.block.Block;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand All @@ -136,8 +141,24 @@ public class GuiHandler implements IGuiHandler {

@Override
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {

TileEntity entity = world.getTileEntity(new BlockPos(x, y, z));

if(entity instanceof IGUIProvider) {
return ((IGUIProvider) entity).provideContainer(ID, player, world, x, y, z);
}

IBlockState b = world.getBlockState(new BlockPos(x, y, z));

if(b instanceof IGUIProvider) {
return ((IGUIProvider) b).provideContainer(ID, player, world, x, y, z);
}

ItemStack item = player.getHeldItemMainhand();

if(item != null && item.getItem() instanceof IGUIProvider) {
return ((IGUIProvider) item.getItem()).provideContainer(ID, player, world, x, y, z);
}

switch(ID) {
case ModBlocks.guiID_machine_press:
if(entity instanceof TileEntityMachinePress) {
Expand Down Expand Up @@ -657,6 +678,23 @@ public Object getServerGuiElement(int ID, EntityPlayer player, World world, int
@Override
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
TileEntity entity = world.getTileEntity(new BlockPos(x, y, z));

if(entity instanceof IGUIProvider) {
return ((IGUIProvider) entity).provideGUI(ID, player, world, x, y, z);
}

IBlockState b = world.getBlockState(new BlockPos(x, y, z));

if(b instanceof IGUIProvider) {
return ((IGUIProvider) b).provideGUI(ID, player, world, x, y, z);
}

ItemStack item = player.getHeldItemMainhand();

if(item != null && item.getItem() instanceof IGUIProvider) {
return ((IGUIProvider) item.getItem()).provideGUI(ID, player, world, x, y, z);
}

switch(ID) {
case ModBlocks.guiID_machine_press:
if(entity instanceof TileEntityMachinePress) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/hbm/hfr/render/loader/S_Face.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public void addFaceForRender(BufferBuilder tessellator, float textureOffset) {

tessellator.pos(this.vertices[i].x, this.vertices[i].y, this.vertices[i].z).tex(this.textureCoordinates[i].u + offsetU, this.textureCoordinates[i].v + offsetV).normal(normalX, normalY, normalZ).endVertex();
} else {
tessellator.pos(this.vertices[i].x, this.vertices[i].y, this.vertices[i].z).normal(normalX, normalY, normalZ).endVertex();
tessellator.pos(this.vertices[i].x, this.vertices[i].y, this.vertices[i].z).tex(0, 0).normal(normalX, normalY, normalZ).endVertex();
}
}
}
Expand Down
26 changes: 21 additions & 5 deletions src/main/java/com/hbm/inventory/AnvilRecipes.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.hbm.inventory;


import static com.hbm.inventory.OreDictManager.*;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -137,7 +139,7 @@ public static void registerConstructionRecipes() {
new AStack[] {new OreDictStack("plateIron", 2), new ComparableStack(ModItems.coil_copper), new ComparableStack(ModItems.coil_copper_torus)},
new AnvilOutput(new ItemStack(ModItems.motor, 2))).setTier(1));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.motor), new OreDictStack("ingotPolymer", 2), new OreDictStack("ingotDesh", 2), new ComparableStack(ModItems.coil_gold_torus)},
new AStack[] {new ComparableStack(ModItems.motor), new OreDictStack("ingotPolymer", 2), new OreDictStack(DESH.ingot(), 2), new ComparableStack(ModItems.coil_gold_torus)},
new AnvilOutput(new ItemStack(ModItems.motor_desh, 1))).setTier(3));

constructionRecipes.add(new AnvilConstructionRecipe(
Expand All @@ -159,7 +161,21 @@ public static void registerConstructionRecipes() {
new ComparableStack(ModItems.circuit_aluminium, 1 * ukModifier)
},
new AnvilOutput(new ItemStack(ModBlocks.machine_assembler))).setTier(2));


constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new ComparableStack(Blocks.FURNACE),
new OreDictStack(STEEL.plate(), 8),
new OreDictStack(CU.ingot(), 8)
}, new AnvilOutput(new ItemStack(ModBlocks.heater_firebox))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new ComparableStack(Blocks.STONEBRICK, 16),
new OreDictStack(IRON.ingot(), 4),
new OreDictStack(STEEL.plate(), 16),
new OreDictStack(CU.ingot(), 8),
new ComparableStack(ModBlocks.steel_grate, 16)
}, new AnvilOutput(new ItemStack(ModBlocks.furnace_steel))).setTier(2));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {
new ComparableStack(ModBlocks.brick_concrete, 64),
Expand All @@ -185,13 +201,13 @@ public static void registerConstructionRecipes() {
new AnvilOutput(new ItemStack(ModItems.wings_limp))).setTier(2));

constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotDesh", 4), new OreDictStack("dustPolymer", 2), new ComparableStack(ModItems.ingot_dura_steel, 1)},
new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack("dustPolymer", 2), new ComparableStack(ModItems.ingot_dura_steel, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_desh, 4))).setTier(3));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotEuphemium", 4), new ComparableStack(ModItems.powder_astatine, 2), new ComparableStack(ModItems.gem_volcanic, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new OreDictStack("ingotDineutronium", 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack("ingotDesh", 1)},
new AStack[] {new OreDictStack("ingotDineutronium", 4), new ComparableStack(ModItems.powder_spark_mix, 2), new OreDictStack(DESH.ingot(), 1)},
new AnvilOutput(new ItemStack(ModItems.plate_dineutronium, 4))).setTier(7));

constructionRecipes.add(new AnvilConstructionRecipe(
Expand All @@ -207,7 +223,7 @@ public static void registerConstructionRecipes() {
new AStack[] {new OreDictStack(OreDictManager.getReflector(), 4), new ComparableStack(ModItems.ingot_starmetal, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 6)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_lunar))).setTier(4));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.ingot_meteorite_forged, 4), new OreDictStack("ingotDesh", 1), new ComparableStack(ModItems.billet_yharonite, 1)},
new AStack[] {new ComparableStack(ModItems.ingot_meteorite_forged, 4), new OreDictStack(DESH.ingot(), 1), new ComparableStack(ModItems.billet_yharonite, 1)},
new AnvilOutput(new ItemStack(ModItems.plate_armor_fau))).setTier(6));
constructionRecipes.add(new AnvilConstructionRecipe(
new AStack[] {new ComparableStack(ModItems.plate_dineutronium, 4), new ComparableStack(ModItems.particle_sparkticle, 1), new ComparableStack(ModItems.plate_armor_fau, 6)},
Expand Down
Loading

0 comments on commit dcd89e6

Please sign in to comment.