funky NEI handling memes, arsenic

This commit is contained in:
Bob 2022-04-05 20:30:29 +02:00
parent a3398eb416
commit 7d3a4d197b
18 changed files with 106 additions and 37 deletions

View File

@ -463,6 +463,7 @@ public class ModBlocks {
public static Block dirt_oily;
public static Block sand_dirty;
public static Block sand_dirty_red;
public static Block stone_cracked;
public static Block burning_earth;
public static Block tektite;
public static Block ore_tektite_osmiridium;
@ -1679,16 +1680,17 @@ public class ModBlocks {
fallout = new BlockFallout(Material.snow).setBlockName("fallout").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":ash");
foam_layer = new BlockLayering(Material.snow).setBlockName("foam_layer").setStepSound(Block.soundTypeSnow).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":foam");
sand_boron_layer = new BlockLayering(Material.sand).setBlockName("sand_boron_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":sand_boron");
leaves_layer = new BlockLayering(Material.leaves).setBlockName("leaves_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":waste_leaves");
leaves_layer = new BlockLayering(Material.leaves).setBlockName("leaves_layer").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":waste_leaves");
burning_earth = new WasteEarth(Material.ground, true).setBlockName("burning_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":burning_earth");
tektite = new BlockGeneric(Material.sand).setBlockName("tektite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":tektite");
ore_tektite_osmiridium = new BlockGeneric(Material.sand).setBlockName("ore_tektite_osmiridium").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":ore_tektite_osmiridium");
impact_dirt = new BlockDirt(Material.ground, true).setBlockName("impact_dirt").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":waste_earth_bottom");
dirt_dead = new BlockGeneric(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
dirt_oily = new BlockGeneric(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
dirt_dead = new BlockFalling(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
dirt_oily = new BlockFalling(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
sand_dirty = new BlockFalling(Material.sand).setBlockName("sand_dirty").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty");
sand_dirty_red = new BlockFalling(Material.sand).setBlockName("sand_dirty_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty_red");
stone_cracked = new BlockFalling(Material.rock).setBlockName("stone_cracked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":stone_cracked");
sellafield_slaked = new BlockGeneric(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
sellafield_0 = new BlockHazard(Material.rock).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
@ -2707,6 +2709,7 @@ public class ModBlocks {
GameRegistry.registerBlock(dirt_oily, dirt_oily.getUnlocalizedName());
GameRegistry.registerBlock(sand_dirty, sand_dirty.getUnlocalizedName());
GameRegistry.registerBlock(sand_dirty_red, sand_dirty_red.getUnlocalizedName());
GameRegistry.registerBlock(stone_cracked, stone_cracked.getUnlocalizedName());
GameRegistry.registerBlock(fallout, fallout.getUnlocalizedName());
GameRegistry.registerBlock(foam_layer, foam_layer.getUnlocalizedName());
GameRegistry.registerBlock(sand_boron_layer, sand_boron_layer.getUnlocalizedName());

View File

@ -84,9 +84,9 @@ public class BlockLayering extends Block {
}
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
if(p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) {
/*if(p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) {
p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_);
}
}*/
}
@SideOnly(Side.CLIENT)

View File

@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
import java.util.Random;
import com.hbm.blocks.ModBlocks;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -10,16 +11,17 @@ 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.item.EntityFallingBlock;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
public class WasteLeaves extends Block {
public WasteLeaves(Material mat) {
super(mat);
this.setTickRandomly(true);
}
@Override
@ -36,8 +38,15 @@ public class WasteLeaves extends Block {
@Override
public void updateTick(World world, int x, int y, int z, Random rand) {
if(rand.nextInt(60) == 0) {
if(rand.nextInt(30) == 0) {
world.setBlockToAir(x, y, z);
if(world.getBlock(x, y - 1, z).getMaterial() == Material.air) {
EntityFallingBlock leaves = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, ModBlocks.leaves_layer);
leaves.field_145812_b = 2;
leaves.field_145813_c = false;
world.spawnEntityInWorld(leaves);
}
}
super.updateTick(world, x, y, z, rand);

View File

@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.RefineryRecipes;
public class CrackingHandler extends NEIUniversalHandler {
public CrackingHandler() {
super("ntmCracking", "Cracking", ModBlocks.machine_catalytic_cracker, RefineryRecipes.getCrackingRecipesForNEI());
super("Cracking", ModBlocks.machine_catalytic_cracker, RefineryRecipes.getCrackingRecipesForNEI());
}
@Override
public String getKey() {
return "ntmCracking";
}
}

View File

@ -78,6 +78,10 @@ public class CrystallizerRecipeHandler extends TemplateRecipeHandler {
Map<Object, Object> recipes = CrystallizerRecipes.getRecipes();
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
if(recipe.getKey() instanceof ItemStack && ((ItemStack)recipe.getKey()).getItem() == ModItems.scrap_plastic)
continue;
this.arecipes.add(new RecipeSet(recipe.getKey(), (ItemStack)recipe.getValue()));
}

View File

@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.RefineryRecipes;
public class FractioningHandler extends NEIUniversalHandler {
public FractioningHandler() {
super("ntmFractioning", "Fractioning", ModBlocks.machine_fraction_tower, RefineryRecipes.getFractionRecipesForNEI());
super("Fractioning", ModBlocks.machine_fraction_tower, RefineryRecipes.getFractionRecipesForNEI());
}
@Override
public String getKey() {
return "ntmFractioning";
}
}

View File

@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.LiquefactionRecipes;
public class LiquefactionHandler extends NEIUniversalHandler {
public LiquefactionHandler() {
super("ntmLiquefaction", "Liquefaction", ModBlocks.machine_liquefactor, LiquefactionRecipes.getRecipes());
super("Liquefaction", ModBlocks.machine_liquefactor, LiquefactionRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmLiquefaction";
}
}

View File

@ -30,21 +30,19 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
/// SETUP ///
public final String display;
public final String key;
public final ItemStack[] machine;
public final HashMap<Object, Object> recipes;
/// SETUP ///
public NEIUniversalHandler(String key, String display, ItemStack machine[], HashMap recipes) {
this.key = key;
public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
this.display = display;
this.machine = machine;
this.recipes = recipes;
}
public NEIUniversalHandler(String key, String display, ItemStack machine, HashMap recipes) { this(key, display, new ItemStack[]{machine}, recipes); }
public NEIUniversalHandler(String key, String display, Item machine, HashMap recipes) { this(key, display, new ItemStack(machine), recipes); }
public NEIUniversalHandler(String key, String display, Block machine, HashMap recipes) { this(key, display, new ItemStack(machine), recipes); }
public NEIUniversalHandler(String display, ItemStack machine, HashMap recipes) { this(display, new ItemStack[]{machine}, recipes); }
public NEIUniversalHandler(String display, Item machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
public NEIUniversalHandler(String display, Block machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
@ -116,7 +114,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals(key)) {
if(outputId.equals(getKey())) {
for(Entry<Object, Object> recipe : recipes.entrySet()) {
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
@ -150,9 +148,8 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals(key)) {
loadCraftingRecipes(key, new Object[0]);
if(inputId.equals(getKey())) {
loadCraftingRecipes(getKey(), new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
@ -182,10 +179,12 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
transferRectsGui = new LinkedList<RecipeTransferRect>();
//guiGui = new LinkedList<Class<? extends GuiContainer>>();
transferRects.add(new RecipeTransferRect(new Rectangle(147, 1, 18, 18), key));
transferRects.add(new RecipeTransferRect(new Rectangle(147, 1, 18, 18), getKey()));
//transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2, 89 - 7 - 11, 18 * 5 - 4, 18 + 16), key));
//guiGui.add(GUIMachineAssembler.class);
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
//RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
public abstract String getKey();
}

View File

@ -8,11 +8,16 @@ import net.minecraft.item.ItemStack;
public class RTGRecipeHandler extends NEIUniversalHandler {
public RTGRecipeHandler() {
super("ntmRTG", "RTG", new ItemStack[] {
super("RTG", new ItemStack[] {
new ItemStack(ModBlocks.machine_rtg_grey),
new ItemStack(ModBlocks.machine_difurnace_rtg_off),
new ItemStack(ModBlocks.machine_industrial_generator),
new ItemStack(ModBlocks.machine_rtg_furnace_off)
}, ItemRTGPellet.getRecipeMap());
}
@Override
public String getKey() {
return "ntmRTG";
}
}

View File

@ -3,9 +3,16 @@ package com.hbm.handler.nei;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.recipes.SolidificationRecipes;
import codechicken.nei.recipe.TemplateRecipeHandler;
public class SolidificationHandler extends NEIUniversalHandler {
public SolidificationHandler() {
super("ntmSolidification", "Solidification", ModBlocks.machine_solidifier, SolidificationRecipes.getRecipes());
super("Solidification", ModBlocks.machine_solidifier, SolidificationRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmSolidification";
}
}

View File

@ -6,6 +6,11 @@ import com.hbm.tileentity.machine.TileEntityReactorZirnox;
public class ZirnoxRecipeHandler extends NEIUniversalHandler {
public ZirnoxRecipeHandler() {
super("ntmZirnox", "ZIRNOX", ModBlocks.reactor_zirnox, TileEntityReactorZirnox.fuelMap);
super("ZIRNOX", ModBlocks.reactor_zirnox, TileEntityReactorZirnox.fuelMap);
}
@Override
public String getKey() {
return "ntmZirnox";
}
}

View File

@ -271,6 +271,8 @@ public class ModItems {
public static Item nugget_lead;
public static Item ingot_bismuth;
public static Item nugget_bismuth;
public static Item ingot_arsenic;
public static Item nugget_arsenic;
public static Item ingot_tantalium;
public static Item nugget_tantalium;
public static Item ingot_niobium;
@ -544,6 +546,8 @@ public class ModItems {
public static Item circuit_schrabidium;
public static Item circuit_bismuth_raw;
public static Item circuit_bismuth;
public static Item circuit_arsenic_raw;
public static Item circuit_arsenic;
public static Item circuit_tantalium_raw;
public static Item circuit_tantalium;
public static Item crt_display;
@ -2814,6 +2818,8 @@ public class ModItems {
nugget_lead = new Item().setUnlocalizedName("nugget_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_lead");
ingot_bismuth = new ItemCustomLore().setUnlocalizedName("ingot_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_bismuth");
nugget_bismuth = new Item().setUnlocalizedName("nugget_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_bismuth");
ingot_arsenic = new ItemCustomLore().setUnlocalizedName("ingot_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_arsenic");
nugget_arsenic = new Item().setUnlocalizedName("nugget_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_arsenic");
ingot_tantalium = new ItemCustomLore().setUnlocalizedName("ingot_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_tantalium");
nugget_tantalium = new ItemCustomLore().setUnlocalizedName("nugget_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_tantalium");
ingot_niobium = new Item().setUnlocalizedName("ingot_niobium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_niobium");
@ -3101,6 +3107,8 @@ public class ModItems {
circuit_schrabidium = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("circuit_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_schrabidium");
circuit_bismuth_raw = new Item().setUnlocalizedName("circuit_bismuth_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_bismuth_raw");
circuit_bismuth = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_bismuth");
circuit_arsenic_raw = new Item().setUnlocalizedName("circuit_arsenic_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_arsenic_raw");
circuit_arsenic = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_arsenic");
circuit_tantalium_raw = new Item().setUnlocalizedName("circuit_tantalium_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium_raw");
circuit_tantalium = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium");
crt_display = new Item().setUnlocalizedName("crt_display").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crt_display");
@ -5685,6 +5693,7 @@ public class ModItems {
GameRegistry.registerItem(ingot_tcalloy, ingot_tcalloy.getUnlocalizedName());
GameRegistry.registerItem(ingot_lead, ingot_lead.getUnlocalizedName());
GameRegistry.registerItem(ingot_bismuth, ingot_bismuth.getUnlocalizedName());
GameRegistry.registerItem(ingot_arsenic, ingot_arsenic.getUnlocalizedName());
GameRegistry.registerItem(ingot_tantalium, ingot_tantalium.getUnlocalizedName());
GameRegistry.registerItem(ingot_niobium, ingot_niobium.getUnlocalizedName());
GameRegistry.registerItem(ingot_beryllium, ingot_beryllium.getUnlocalizedName());
@ -6005,6 +6014,7 @@ public class ModItems {
GameRegistry.registerItem(nugget_actinium, nugget_actinium.getUnlocalizedName());
GameRegistry.registerItem(nugget_lead, nugget_lead.getUnlocalizedName());
GameRegistry.registerItem(nugget_bismuth, nugget_bismuth.getUnlocalizedName());
GameRegistry.registerItem(nugget_arsenic, nugget_arsenic.getUnlocalizedName());
GameRegistry.registerItem(nugget_tantalium, nugget_tantalium.getUnlocalizedName());
GameRegistry.registerItem(nugget_beryllium, nugget_beryllium.getUnlocalizedName());
GameRegistry.registerItem(nugget_schrabidium, nugget_schrabidium.getUnlocalizedName());
@ -6217,6 +6227,8 @@ public class ModItems {
GameRegistry.registerItem(circuit_schrabidium, circuit_schrabidium.getUnlocalizedName());
GameRegistry.registerItem(circuit_bismuth_raw, circuit_bismuth_raw.getUnlocalizedName());
GameRegistry.registerItem(circuit_bismuth, circuit_bismuth.getUnlocalizedName());
GameRegistry.registerItem(circuit_arsenic_raw, circuit_arsenic_raw.getUnlocalizedName());
GameRegistry.registerItem(circuit_arsenic, circuit_arsenic.getUnlocalizedName());
GameRegistry.registerItem(circuit_tantalium_raw, circuit_tantalium_raw.getUnlocalizedName());
GameRegistry.registerItem(circuit_tantalium, circuit_tantalium.getUnlocalizedName());
GameRegistry.registerItem(crt_display, crt_display.getUnlocalizedName());

View File

@ -14,22 +14,32 @@ public class OilSpot {
for(int i = 0; i < count; i++) {
int rX = x + (int)(world.rand.nextGaussian() * width);
int rZ = z + (int)(world.rand.nextGaussian() * width);
int rY = world.getHeightValue(rX, rZ) - 1;
int rY = world.getHeightValue(rX, rZ);
Block ground = world.getBlock(rX, rY, rZ);
if(ground == Blocks.grass || ground == Blocks.dirt) {
world.setBlock(rX, rY, rZ, world.rand.nextInt(10) == 0 ? ModBlocks.dirt_oily : ModBlocks.dirt_dead);
for(int y = rY; y > rY - 4; y--) {
} else if(ground == Blocks.sand || ground == ModBlocks.ore_oil_sand) {
Block ground = world.getBlock(rX, y, rZ);
if(world.getBlockMetadata(rX, rY, rZ) == 1)
world.setBlock(rX, rY, rZ, ModBlocks.sand_dirty_red);
else
world.setBlock(rX, rY, rZ, ModBlocks.sand_dirty);
} else if(ground.getMaterial() == Material.leaves) {
world.setBlockToAir(rX, rY, rZ);
if(ground == Blocks.grass || ground == Blocks.dirt) {
world.setBlock(rX, y, rZ, world.rand.nextInt(10) == 0 ? ModBlocks.dirt_oily : ModBlocks.dirt_dead);
break;
} else if(ground == Blocks.sand || ground == ModBlocks.ore_oil_sand) {
if(world.getBlockMetadata(rX, y, rZ) == 1)
world.setBlock(rX, y, rZ, ModBlocks.sand_dirty_red);
else
world.setBlock(rX, y, rZ, ModBlocks.sand_dirty);
break;
} else if(ground == Blocks.stone) {
world.setBlock(rX, y, rZ, ModBlocks.stone_cracked);
break;
} else if(ground.getMaterial() == Material.leaves) {
world.setBlockToAir(rX, y, rZ);
break;
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 753 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 474 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 420 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 523 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B