Skip to content

Commit

Permalink
Minor update 1.2.1-beta
Browse files Browse the repository at this point in the history
- Added bedrock to blend with other stones better
- Added dimension type check, will now ignore nether and end
  • Loading branch information
uberifix committed Mar 17, 2020
1 parent 360c352 commit 66d1b29
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ public class GeoExpansionResourceGenerator {
resourceMap.put("mc.dirt", "minecraft:blocks/dirt");
resourceMap.put("mc.clay", "minecraft:blocks/clay");

resourceMap.put("mc.bedrock", "minecraft:blocks/bedrock");

resourceMap.put("mc.ore_coal", "minecraft:blocks/coal_ore");
resourceMap.put("mc.ore_iron", "minecraft:blocks/iron_ore");
resourceMap.put("mc.ore_gold", "minecraft:blocks/gold_ore");
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
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.12.2-1.2.0-beta"
version = "1.12.2-1.2.1-beta"
group = "network.pxl8.geoexpansion"
archivesBaseName = "geoexpansion"

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
package network.pxl8.geoexpansion.common.blocks;

import net.minecraft.block.material.EnumPushReaction;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Items;
import net.minecraft.item.Item;

import java.util.Random;

public class BlockBedrock extends BlockStone {

BlockBedrock() {
super("mc.bedrock", "", -1.0F, "minecraft:bedrock", "");
this.setResistance(6000000.0F);
this.disableStats();
}

@Override
public String getHarvestTool(IBlockState state) { return null; }

@Override
public int getHarvestLevel(IBlockState state) { return -1; }

@Override
public int quantityDropped(Random random) { return 0; }

@Override
public Item getItemDropped(IBlockState state, Random rand, int fortune) { return Items.AIR; }

@Override
public EnumPushReaction getMobilityFlag(IBlockState state) { return EnumPushReaction.BLOCK; }

@Override
public boolean isOpaqueCube(IBlockState state)
{
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ public class ModBlocks {
@GameRegistry.ObjectHolder("mc.dirt") public static BlockStone blockDirt;
@GameRegistry.ObjectHolder("mc.clay") public static BlockStone blockClay;

@GameRegistry.ObjectHolder("mc.bedrock") public static BlockBedrock blockBedrock;

@GameRegistry.ObjectHolder("mc.ore_coal") public static BlockOre oreCoal;
@GameRegistry.ObjectHolder("mc.ore_iron") public static BlockOre oreIron;
@GameRegistry.ObjectHolder("mc.ore_gold") public static BlockOre oreGold;
Expand Down Expand Up @@ -73,6 +75,8 @@ private static void addStoneBlocks() {

blockStoneList.add(blockDirt);
blockStoneList.add(blockClay);

blockStoneList.add(blockBedrock);
}

private static void addOreBlocks() {
Expand Down Expand Up @@ -114,6 +118,8 @@ public static void registerModBlocks(IForgeRegistry<Block> blockReg) {
blockReg.register(new BlockStone("mc.dirt", "shovel", 0.5F, "minecraft:dirt", "minecraft:dirt", Material.GROUND).setSound(SoundType.GROUND));
blockReg.register(new BlockStone("mc.clay", "shovel", 0.6F, "minecraft:clay", "minecraft:clay_ball/0/4", Material.CLAY).setSound(SoundType.GROUND));

blockReg.register(new BlockBedrock().setLightOpacity(14));

blockReg.register(new BlockOre("mc.ore_coal", 2.0F, "minecraft:coal_ore", "geoexpansion:mc.ore_cluster_coal"));
blockReg.register(new BlockOre("mc.ore_iron", 2.0F, "minecraft:iron_ore", "geoexpansion:mc.ore_cluster_iron"));
blockReg.register(new BlockOre("mc.ore_gold", 2.0F, "minecraft:gold_ore", "geoexpansion:mc.ore_cluster_gold"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.minecraft.block.state.IBlockState;
import net.minecraft.init.Blocks;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.DimensionType;
import net.minecraft.world.World;
import net.minecraft.world.WorldServer;
import net.minecraft.world.chunk.IChunkProvider;
Expand Down Expand Up @@ -54,9 +55,10 @@ public class StoneWorldGen implements IWorldGenerator {
}

public void generate(Random random, int chunkX, int chunkZ, World world, IChunkGenerator chunkGenerator, IChunkProvider chunkProvider) {
if (!(world instanceof WorldServer)) {
return;
}

if (!(world instanceof WorldServer)) { return; }
if (world.provider.getDimensionType().equals(DimensionType.NETHER) || world.provider.getDimensionType().equals(DimensionType.THE_END)) { return; }

int posX = (chunkX * 16) + 1;
int posZ = (chunkZ * 16) + 1;

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/network/pxl8/geoexpansion/lib/LibMeta.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

public class LibMeta {
public static final String MOD_ID = "geoexpansion";
public static final String VERSION = "1.2.0-beta";
public static final String VERSION = "1.2.1-beta";

public static final String SERVER_PROXY = "network.pxl8.geoexpansion.proxy.CommonProxy";
public static final String CLIENT_PROXY = "network.pxl8.geoexpansion.proxy.ClientProxy";
Expand Down
19 changes: 19 additions & 0 deletions src/main/resources/assets/geoexpansion/blockstates/mc.bedrock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"forge_marker": 1,
"defaults": {
"model": "geoexpansion:tinted_block",
"textures": {
"particle": "minecraft:blocks/bedrock",
"all": "minecraft:blocks/bedrock"
},
"uvlock": true
},
"variants": {
"density": {
"soft": {},
"firm": {},
"solid": {},
"hard": {}
}
}
}
3 changes: 2 additions & 1 deletion src/main/resources/assets/geoexpansion/lang/en_us.lang
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,9 @@ tile.geoexpansion.mc.infested_stone_brick_cracked.name=Ancient Cracked Stone Bri
tile.geoexpansion.mc.infested_stone_brick_chiseled.name=Ancient Chiseled Stone Brick

tile.geoexpansion.mc.dirt.name=Dirt
tile.geoexpansion.mc.gravel.name=Gravel
tile.geoexpansion.mc.clay.name=Clay

tile.geoexpansion.mc.bedrock.name=Bedrock
# Ores
tile.geoexpansion.mc.ore_coal.name=Coal Ore
tile.geoexpansion.mc.ore_iron.name=Iron Ore
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "minecraft:blocks/bedrock"
}
}

0 comments on commit 66d1b29

Please sign in to comment.