Skip to content

Commit

Permalink
Quack Pack 5
Browse files Browse the repository at this point in the history
Signed-off-by: Drillgon Chickens <drillgon200@gmail.com>
  • Loading branch information
Drillgon200 committed Oct 1, 2021
1 parent 6ee3cfa commit 30df900
Show file tree
Hide file tree
Showing 27 changed files with 174 additions and 163 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Expand Up @@ -11,7 +11,7 @@ apply plugin: 'net.minecraftforge.gradle.forge'
//Only edit below this line, the above code adds and enables the necessary things for Forge to be setup.


version = "1.6.3a"
version = "1.6.4a"
group = "com.hbm" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "hbm"

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/hbm/blocks/ModBlocks.java
Expand Up @@ -784,9 +784,9 @@ public SoundEvent getBreakSound() {
public static final Block red_pylon = new PylonRedWire(Material.IRON, "red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_battery_potato = new MachineBattery(Material.IRON, 10000, "machine_battery_potato").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_battery = new MachineBattery(Material.IRON, 1000000, "machine_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_lithium_battery = new MachineBattery(Material.IRON, 15000000, "machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_schrabidium_battery = new MachineBattery(Material.IRON, 500000000, "machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_dineutronium_battery = new MachineBattery(Material.IRON, 150000000000L, "machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_lithium_battery = new MachineBattery(Material.IRON, 50000000, "machine_lithium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_schrabidium_battery = new MachineBattery(Material.IRON, 25000000000L, "machine_schrabidium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_dineutronium_battery = new MachineBattery(Material.IRON, 1000000000000L, "machine_dineutronium_battery").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final Block machine_fensu = new MachineFENSU(Material.IRON, "machine_fensu").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
public static final int guiID_machine_battery = 21;

Expand Down
103 changes: 27 additions & 76 deletions src/main/java/com/hbm/blocks/generic/WasteEarth.java
Expand Up @@ -92,83 +92,34 @@ public void randomDisplayTick(IBlockState stateIn, World worldIn, BlockPos pos,

@Override
public void updateTick(World world, BlockPos pos1, IBlockState state, Random rand) {
if(this.radIn > 0){
RadiationSavedData.incrementRad(world, pos1, this.radIn, this.radMax);
world.scheduleUpdate(pos1, state.getBlock(), this.tickRate(world));
int x = pos1.getX();
int y = pos1.getY();
int z = pos1.getZ();
if(this == ModBlocks.waste_mycelium && GeneralConfig.enableMycelium) {
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
Block b0 = world.getBlockState(new BlockPos(x + i, y + j, z + k)).getBlock();
IBlockState b1 = world.getBlockState(new BlockPos(x + i, y + j + 1, z + k));
if(!b1.isOpaqueCube() && (b0 == Blocks.DIRT || b0 == Blocks.GRASS || b0 == Blocks.MYCELIUM || b0 == ModBlocks.waste_earth)) {
world.setBlockState(new BlockPos(x + i, y + j, z + k), ModBlocks.waste_mycelium.getDefaultState());
}
}
}
}
}

if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) {

if(GeneralConfig.enableAutoCleanup || (world.getLightBrightness(new BlockPos(x, y + 1, z)) < 4 && world.getBlockLightOpacity(new BlockPos(x, y + 1, z)) > 2)) {
world.setBlockState(new BlockPos(x, y, z), Blocks.DIRT.getDefaultState());

}

if(world.getBlockState(new BlockPos(x, y + 1, z)).getBlock() instanceof BlockMushroom) {
world.setBlockState(new BlockPos(x, y + 1, z), ModBlocks.mush.getDefaultState());
}
}
MutableBlockPos pos = new BlockPos.MutableBlockPos().setPos(pos1.getX(), pos1.getY(), pos1.getZ());
if((this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) && world.getBlockState(pos.add(0, 1, 0)).getBlock() == Blocks.AIR && rand.nextInt(1000) == 0)
{
Block b0;
int count = 0;
for(int i = -5; i < 5; i++) {
for(int j = -5; j < 6; j++) {
for(int k = -5; k < 5; k++) {
if(world.isBlockLoaded((pos.add(i, j, k)))){
b0 = world.getBlockState(pos.add(i, j, k)).getBlock();
if((b0 instanceof BlockMushroom) || b0 == ModBlocks.mush)
{
count++;
}
}

}
}
}
if(count > 0 && count < 5)
world.setBlockState(pos.add(0, 1, 0), ModBlocks.mush.getDefaultState());
}

if(this == ModBlocks.waste_mycelium && GeneralConfig.enableMycelium)
{
for(int i = -1; i < 2; i++) {
for(int j = -1; j < 2; j++) {
for(int k = -1; k < 2; k++) {
IBlockState bs = world.getBlockState(pos.add(0, 1, 0));
Block b0 = world.getBlockState(pos.add(i, j, k)).getBlock();
Block b1 = world.getBlockState(pos.add(0, 1, 0)).getBlock();
if(!bs.isOpaqueCube() && (b0 == Blocks.DIRT || b0 == Blocks.GRASS || b0 == Blocks.MYCELIUM || b0 == ModBlocks.waste_earth))
{
world.setBlockState(pos.add(i, j, k), ModBlocks.waste_mycelium.getDefaultState());
}
}
}
}

if(rand.nextInt(10) == 0) {
Block b0;
int count = 0;
for(int i = -5; i < 5; i++) {
for(int j = -5; j < 6; j++) {
for(int k = -5; k < 5; k++) {
b0 = world.getBlockState(pos.add(i, j, k)).getBlock();
if(b0 == ModBlocks.mush)
{
count++;
}
}
}
}
if(count < 5)
world.setBlockState(pos.add(0, 1, 0), ModBlocks.mush.getDefaultState());
}
}

if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium)
{
if (!world.isRemote)
{
if (world.getLight(pos.add(0, 1, 0)) < 4 && world.getLight(pos.add(0, 1, 0)) > 2)
{

world.setBlockState(pos, Blocks.DIRT.getDefaultState());
}
}
}

if(GeneralConfig.enableAutoCleanup && (this == ModBlocks.waste_earth | this == ModBlocks.waste_mycelium))
if(!world.isRemote)
world.setBlockState(pos, Blocks.DIRT.getDefaultState());
}

@Override
Expand Down
Expand Up @@ -22,7 +22,7 @@ public class MKUCraftingHandler extends net.minecraftforge.registries.IForgeRegi
@Override
public boolean matches(InventoryCrafting inventory, World world) {

if(world == null || world.provider == null || world.getWorldInfo() == null)
if(world == null || world.provider == null || world.getWorldInfo() == null || HbmWorldUtility.getProviderWorld(world.provider) == null)
return false;

if(MKURecipe == null || world.getSeed() != lastSeed)
Expand Down

0 comments on commit 30df900

Please sign in to comment.