Skip to content

Commit

Permalink
Cactus/Sugar Charcoal/Coke Blocks (#3269)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Robertz <dream-master@gmx.net>
  • Loading branch information
Cleptomania and Dream-Master authored Sep 24, 2024
1 parent 750ccb5 commit c3c5780
Show file tree
Hide file tree
Showing 32 changed files with 339 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/gregtech/api/recipe/RecipeMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import java.util.Optional;

import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidStack;

Expand Down Expand Up @@ -85,6 +86,7 @@
import gregtech.nei.formatter.FusionSpecialValueFormatter;
import gregtech.nei.formatter.HeatingCoilSpecialValueFormatter;
import gregtech.nei.formatter.SimpleSpecialValueFormatter;
import gtPlusPlus.core.block.ModBlocks;
import gtPlusPlus.core.item.ModItems;
import mods.railcraft.common.blocks.aesthetics.cube.EnumCube;
import mods.railcraft.common.items.RailcraftToolItems;
Expand Down Expand Up @@ -685,6 +687,22 @@ else if (Materials.PhasedIron.getMolten(1)
.setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount / 2))
.setDuration(aDuration * 20 / 3);
}
ItemStack cactusCokeBlock = new ItemStack(
Item.getItemFromBlock(ModBlocks.blockCactusCoke),
aCoalAmount * 2,
0);
ItemStack sugarCokeBlock = new ItemStack(
Item.getItemFromBlock(ModBlocks.blockSugarCoke),
aCoalAmount * 2,
0);
coll.derive()
.setInputs(aInput1, aInput2, cactusCokeBlock)
.setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount * 2))
.setDuration(aDuration * 20 / 3);
coll.derive()
.setInputs(aInput1, aInput2, sugarCokeBlock)
.setOutputs(aOutput1, aOutput2, Materials.Ash.getDust(aCoalAmount * 2))
.setDuration(aDuration * 20 / 3);
}
return coll.getAll();
})
Expand Down
14 changes: 14 additions & 0 deletions src/main/java/gtPlusPlus/core/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
import net.minecraftforge.fluids.Fluid;

import gtPlusPlus.api.objects.Logger;
import gtPlusPlus.core.block.fuel.BlockCactusCharcoal;
import gtPlusPlus.core.block.fuel.BlockCactusCoke;
import gtPlusPlus.core.block.fuel.BlockSugarCharcoal;
import gtPlusPlus.core.block.fuel.BlockSugarCoke;
import gtPlusPlus.core.block.general.BlockCompressedObsidian;
import gtPlusPlus.core.block.general.BlockFluidTankInfinite;
import gtPlusPlus.core.block.general.BlockHellFire;
Expand Down Expand Up @@ -53,6 +57,11 @@ public final class ModBlocks {
public static Block blockWitherGuard;
public static Block blockCompressedObsidian;

public static Block blockCactusCharcoal;
public static Block blockCactusCoke;
public static Block blockSugarCharcoal;
public static Block blockSugarCoke;

public static Block blockCustomJukebox;

public static Block blockPooCollector;
Expand Down Expand Up @@ -82,6 +91,11 @@ public static void registerBlocks() {
blockWitherGuard = new BlockWitherProof();
blockCompressedObsidian = new BlockCompressedObsidian();

blockCactusCharcoal = new BlockCactusCharcoal();
blockCactusCoke = new BlockCactusCoke();
blockSugarCharcoal = new BlockSugarCharcoal();
blockSugarCoke = new BlockSugarCoke();

blockCircuitProgrammer = new BlockCircuitProgrammer();

blockDecayablesChest = new BlockDecayablesChest();
Expand Down
55 changes: 55 additions & 0 deletions src/main/java/gtPlusPlus/core/block/fuel/BlockCactusCharcoal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package gtPlusPlus.core.block.fuel;

import static gregtech.api.enums.Mods.GTPlusPlus;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class BlockCactusCharcoal extends Block {

private final IIcon[] textureArray = new IIcon[6];

public BlockCactusCharcoal() {
super(Material.rock);
this.setBlockName("blockCactusCharcoal");
this.setStepSound(soundTypeStone);
GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCactusCharcoal");
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
for (int i = 0; i < textureArray.length; i++) {
this.textureArray[i] = iconRegister.registerIcon(GTPlusPlus.ID + ":fuel/blockCactusCharcoal" + i);
}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.textureArray[meta];
}

@Override
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
for (int i = 0; i < textureArray.length; i++) {
ItemStack is = new ItemStack(item, 1, i);
ItemUtils.registerFuel(is, 4000 * (int) Math.pow(9, i));
list.add(is);
}
}

}
55 changes: 55 additions & 0 deletions src/main/java/gtPlusPlus/core/block/fuel/BlockCactusCoke.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package gtPlusPlus.core.block.fuel;

import static gregtech.api.enums.Mods.GTPlusPlus;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class BlockCactusCoke extends Block {

private final IIcon[] textureArray = new IIcon[6];

public BlockCactusCoke() {
super(Material.rock);
this.setBlockName("blockCactusCoke");
this.setStepSound(soundTypeStone);
GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockCactusCoke");
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
for (int i = 0; i < textureArray.length; i++) {
this.textureArray[i] = iconRegister.registerIcon(GTPlusPlus.ID + ":fuel/blockCactusCoke" + i);
}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.textureArray[meta];
}

@Override
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
for (int i = 0; i < textureArray.length; i++) {
ItemStack is = new ItemStack(item, 1, i);
ItemUtils.registerFuel(is, 8000 * (int) Math.pow(9, i));
list.add(is);
}
}

}
55 changes: 55 additions & 0 deletions src/main/java/gtPlusPlus/core/block/fuel/BlockSugarCharcoal.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package gtPlusPlus.core.block.fuel;

import static gregtech.api.enums.Mods.GTPlusPlus;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class BlockSugarCharcoal extends Block {

private final IIcon[] textureArray = new IIcon[6];

public BlockSugarCharcoal() {
super(Material.rock);
this.setBlockName("blockSugarCharcoal");
this.setStepSound(soundTypeStone);
GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockSugarCharcoal");
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
for (int i = 0; i < textureArray.length; i++) {
this.textureArray[i] = iconRegister.registerIcon(GTPlusPlus.ID + ":fuel/blockSugarCharcoal" + i);
}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.textureArray[meta];
}

@Override
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
for (int i = 0; i < textureArray.length; i++) {
ItemStack is = new ItemStack(item, 1, i);
ItemUtils.registerFuel(is, 4000 * (int) Math.pow(9, i));
list.add(is);
}
}

}
55 changes: 55 additions & 0 deletions src/main/java/gtPlusPlus/core/block/fuel/BlockSugarCoke.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package gtPlusPlus.core.block.fuel;

import static gregtech.api.enums.Mods.GTPlusPlus;

import java.util.List;

import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IIcon;

import cpw.mods.fml.common.registry.GameRegistry;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import gtPlusPlus.core.item.base.itemblock.ItemBlockMeta;
import gtPlusPlus.core.util.minecraft.ItemUtils;

public class BlockSugarCoke extends Block {

private final IIcon[] textureArray = new IIcon[6];

public BlockSugarCoke() {
super(Material.rock);
this.setBlockName("blockSugarCoke");
this.setStepSound(soundTypeStone);
GameRegistry.registerBlock(this, ItemBlockMeta.class, "blockSugarCoke");
}

@Override
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
for (int i = 0; i < textureArray.length; i++) {
this.textureArray[i] = iconRegister.registerIcon(GTPlusPlus.ID + ":fuel/blockSugarCoke" + i);
}
}

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return this.textureArray[meta];
}

@Override
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
for (int i = 0; i < textureArray.length; i++) {
ItemStack is = new ItemStack(item, 1, i);
ItemUtils.registerFuel(is, 8000 * (int) Math.pow(9, i));
list.add(is);
}
}

}
61 changes: 61 additions & 0 deletions src/main/java/gtPlusPlus/core/recipe/RecipesGeneral.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import static gregtech.api.enums.Mods.EnderIO;
import static gregtech.api.enums.Mods.Thaumcraft;
import static gregtech.api.recipe.RecipeMaps.assemblerRecipes;
import static gregtech.api.recipe.RecipeMaps.compressorRecipes;
import static gregtech.api.util.GTRecipeBuilder.MINUTES;
import static gregtech.api.util.GTRecipeBuilder.SECONDS;
import static gtPlusPlus.core.recipe.common.CI.bitsd;
Expand Down Expand Up @@ -58,6 +59,7 @@ public static void loadRecipes() {
OUTPUT_Blueprint = ItemUtils.getSimpleStack(ModItems.itemBlueprintBase, 2);
run();
addCompressedObsidian();
addFuelBlocks();
migratedRecipes();
}

Expand Down Expand Up @@ -273,6 +275,65 @@ private static void run() {
.addTo(assemblerRecipes);
}

private static void addFuelBlocks() {
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(ModItems.itemCactusCharcoal, 9, 0))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCharcoal, 0, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(ModItems.itemCactusCoke, 9, 0))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCoke, 0, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(ModItems.itemSugarCharcoal, 9, 0))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCharcoal, 0, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
GTValues.RA.stdBuilder()
.itemInputs(new ItemStack(ModItems.itemSugarCoke, 9, 0))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCoke, 0, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
for (int i = 1; i < 6; i++) {
GTValues.RA.stdBuilder()
.itemInputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCharcoal, i - 1, 9))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCharcoal, i, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
}
for (int i = 1; i < 6; i++) {
GTValues.RA.stdBuilder()
.itemInputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCoke, i - 1, 9))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockCactusCoke, i, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
}
for (int i = 1; i < 6; i++) {
GTValues.RA.stdBuilder()
.itemInputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCharcoal, i - 1, 9))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCharcoal, i, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
}
for (int i = 1; i < 6; i++) {
GTValues.RA.stdBuilder()
.itemInputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCoke, i - 1, 9))
.itemOutputs(ItemUtils.simpleMetaStack(ModBlocks.blockSugarCoke, i, 1))
.duration(15 * SECONDS)
.eut(2)
.addTo(compressorRecipes);
}
}

private static boolean addCompressedObsidian() {
// Invert Obsidian
ItemStack aInvertedObsidian = ItemUtils.simpleMetaStack(ModBlocks.blockCompressedObsidian, 5, 1);
Expand Down
Loading

0 comments on commit c3c5780

Please sign in to comment.