mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
fixed blast furnace IO, reeds properly break, funny stone
This commit is contained in:
parent
3f7a446e79
commit
f3e0ad9cc2
@ -3,6 +3,13 @@ package com.hbm.blocks;
|
||||
public class BlockEnums {
|
||||
|
||||
public static enum EnumStoneType {
|
||||
SULFUR,
|
||||
ASBESTOS,
|
||||
HEMATITE,
|
||||
MALACHITE
|
||||
}
|
||||
|
||||
public static enum EnumStalagmiteType {
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
}
|
||||
|
||||
@ -1737,7 +1737,7 @@ public class ModBlocks {
|
||||
|
||||
plant_flower = new BlockNTMFlower().setBlockName("plant_flower").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
plant_dead = new BlockDeadPlant().setBlockName("plant_dead").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
reeds = new BlockReeds().setBlockName("reeds").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
reeds = new BlockReeds().setBlockName("plant_reeds").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGrass).setHardness(0.0F);
|
||||
|
||||
waste_earth = new WasteEarth(Material.ground, true).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_earth");
|
||||
waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side");
|
||||
|
||||
@ -47,6 +47,18 @@ public class BlockReeds extends Block {
|
||||
return this.canPlaceBlockAt(world, x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
super.onNeighborBlockChange(world, x, y, z, block);
|
||||
this.checkAndDropBlock(world, x, y, z);
|
||||
}
|
||||
|
||||
protected void checkAndDropBlock(World world, int x, int y, int z) {
|
||||
if(!this.canBlockStay(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, Blocks.air);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
|
||||
@ -17,7 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
public BlockStalagmite() {
|
||||
super(Material.rock, BlockEnums.EnumStoneType.class, true, true);
|
||||
super(Material.rock, BlockEnums.EnumStalagmiteType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -45,14 +45,16 @@ public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static int getMetaFromResource(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
|
||||
if(this == ModBlocks.stalagmite)
|
||||
return World.doesBlockHaveSolidTopSurface(world, x, y - 1, z);
|
||||
if(this == ModBlocks.stalactite)
|
||||
return world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN);
|
||||
if(this == ModBlocks.stalagmite) return World.doesBlockHaveSolidTopSurface(world, x, y - 1, z);
|
||||
if(this == ModBlocks.stalactite) return world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -192,6 +192,8 @@ public class OreDictManager {
|
||||
public static final DictFrame CINNABAR = new DictFrame("Cinnabar");
|
||||
public static final DictFrame BORAX = new DictFrame("Borax");
|
||||
public static final DictFrame VOLCANIC = new DictFrame("Volcanic");
|
||||
public static final DictFrame HEMATITE = new DictFrame("Hematite");
|
||||
public static final DictFrame MALACHITE = new DictFrame("Malachite");
|
||||
/*
|
||||
* HAZARDS, MISC
|
||||
*/
|
||||
@ -359,6 +361,8 @@ public class OreDictManager {
|
||||
CINNABAR .crystal(cinnebar) .gem(cinnebar) .ore(ore_cinnebar, ore_depth_cinnebar);
|
||||
BORAX .dust(powder_borax) .ore(ore_depth_borax);
|
||||
VOLCANIC .gem(gem_volcanic) .ore(basalt_gem);
|
||||
HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE));
|
||||
MALACHITE .ore(fromOne(stone_resource, EnumStoneType.MALACHITE));
|
||||
|
||||
/*
|
||||
* HAZARDS, MISC
|
||||
|
||||
@ -44,7 +44,7 @@ public class GUIDiFurnace extends GuiContainer {
|
||||
byte dir = i == 0 ? diFurnace.sideUpper : i == 1 ? diFurnace.sideLower : diFurnace.sideFuel;
|
||||
label += ForgeDirection.getOrientation(dir);
|
||||
|
||||
this.func_146283_a(Arrays.asList(new String[] { label }), x, y - 30);
|
||||
this.func_146283_a(Arrays.asList(new String[] { label }), x, y - (slot.getHasStack() ? 15 : 0));
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -174,6 +174,11 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
|
||||
slots[b0] = ItemStack.loadItemStackFromNBT(nbt1);
|
||||
}
|
||||
}
|
||||
|
||||
byte[] modes = nbt.getByteArray("modes");
|
||||
this.sideFuel = modes[0];
|
||||
this.sideUpper = modes[1];
|
||||
this.sideLower = modes[2];
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -192,6 +197,8 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
|
||||
}
|
||||
}
|
||||
nbt.setTag("items", list);
|
||||
|
||||
nbt.setByteArray("modes", new byte[] {(byte) sideFuel, (byte) sideUpper, (byte) sideLower});
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -201,6 +208,11 @@ public class TileEntityDiFurnace extends TileEntity implements ISidedInventory,
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int i, ItemStack itemStack, int j) {
|
||||
|
||||
if(i == 0 && this.sideUpper != j) return false;
|
||||
if(i == 1 && this.sideLower != j) return false;
|
||||
if(i == 2 && this.sideFuel != j) return false;
|
||||
|
||||
return this.isItemValidForSlot(i, itemStack);
|
||||
}
|
||||
|
||||
|
||||
@ -103,7 +103,7 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i < 9) return ShredderRecipes.getShredderResult(stack) != null;
|
||||
if(i < 9) return ShredderRecipes.getShredderResult(stack) != null && !(stack.getItem() instanceof ItemBlades);
|
||||
if(i == 29) return stack.getItem() instanceof IBatteryItem;
|
||||
if(i == 27 || i == 28) return stack.getItem() instanceof ItemBlades;
|
||||
|
||||
@ -177,7 +177,7 @@ public class TileEntityMachineShredder extends TileEntityLoadedBase implements I
|
||||
|
||||
@Override
|
||||
public boolean canInsertItem(int slot, ItemStack itemStack, int side) {
|
||||
if(slot >= 9 || !this.isItemValidForSlot(slot, itemStack))
|
||||
if((slot >= 9 && slot != 27 && slot != 28) || !this.isItemValidForSlot(slot, itemStack))
|
||||
return false;
|
||||
|
||||
if(slots[slot] == null)
|
||||
|
||||
@ -148,10 +148,10 @@ public class OreCave {
|
||||
if((genTarget.getMaterial() == Material.air || !genTarget.isNormalCube()) && event.rand.nextInt(5) == 0 && !genTarget.getMaterial().isLiquid()) {
|
||||
|
||||
if(ModBlocks.stalactite.canPlaceBlockAt(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, ModBlocks.stalactite, ore.meta, 2);
|
||||
world.setBlock(x, y, z, ModBlocks.stalactite, BlockStalagmite.getMetaFromResource(ore.meta), 2);
|
||||
} else {
|
||||
if(ModBlocks.stalagmite.canPlaceBlockAt(world, x, y, z)) {
|
||||
world.setBlock(x, y, z, ModBlocks.stalagmite, ore.meta, 2);
|
||||
world.setBlock(x, y, z, ModBlocks.stalagmite, BlockStalagmite.getMetaFromResource(ore.meta), 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user