Skip to content

Commit

Permalink
Some fixes, more Nether stuff, soul sand valley
Browse files Browse the repository at this point in the history
Soul sand valleys use a very weird hack to prevent wither skeleton spawning in them. This could probably be improved. Also the access transformer just refuses to apply to the armor and enchant functions for some reason.
Fix possibly breaking the entire husk/stray replacement system
Fix deepslate no longer being able to be generated in the deep dark
Tweaked the mud PR and removed an unneeded class
Fix deepslate redstone ore never going unlit
Fix #341

More to come soon :3
  • Loading branch information
Roadhog360 committed Sep 30, 2023
1 parent 975aa83 commit 250d6e3
Show file tree
Hide file tree
Showing 64 changed files with 1,772 additions and 1,471 deletions.
34 changes: 19 additions & 15 deletions src/main/java/ganymedes01/etfuturum/EtFuturum.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
import ganymedes01.etfuturum.api.mappings.BasicMultiBlockSound;
import ganymedes01.etfuturum.blocks.BlockSculk;
import ganymedes01.etfuturum.blocks.BlockSculkCatalyst;
import ganymedes01.etfuturum.blocks.BlockWoodSign;
import ganymedes01.etfuturum.client.BuiltInResourcePack;
import ganymedes01.etfuturum.client.DynamicSoundsResourcePack;
import ganymedes01.etfuturum.client.GrayscaleWaterResourcePack;
Expand All @@ -30,10 +29,7 @@
import ganymedes01.etfuturum.compat.CompatWaila;
import ganymedes01.etfuturum.compat.nei.IMCSenderGTNH;
import ganymedes01.etfuturum.configuration.ConfigBase;
import ganymedes01.etfuturum.configuration.configs.ConfigBlocksItems;
import ganymedes01.etfuturum.configuration.configs.ConfigFunctions;
import ganymedes01.etfuturum.configuration.configs.ConfigModCompat;
import ganymedes01.etfuturum.configuration.configs.ConfigSounds;
import ganymedes01.etfuturum.configuration.configs.*;
import ganymedes01.etfuturum.core.proxy.CommonProxy;
import ganymedes01.etfuturum.entities.ModEntityList;
import ganymedes01.etfuturum.items.ItemWoodSign;
Expand All @@ -46,6 +42,8 @@
import ganymedes01.etfuturum.world.EtFuturumLateWorldGenerator;
import ganymedes01.etfuturum.world.EtFuturumWorldGenerator;
import ganymedes01.etfuturum.world.end.dimension.DimensionProviderEFREnd;
import ganymedes01.etfuturum.world.nether.biome.utils.NetherBiomeManager;
import ganymedes01.etfuturum.world.nether.dimension.DimensionProviderEFRNether;
import ganymedes01.etfuturum.world.structure.OceanMonument;
import makamys.mclib.core.MCLib;
import makamys.mclib.ext.assetdirector.ADConfig;
Expand Down Expand Up @@ -138,7 +136,7 @@ public void displayAllReleventItems(List list) {
Iterator<ItemStack> iterator = list.iterator();
while (iterator.hasNext()) {
ItemStack stack = iterator.next();
for (ModItems sign : ModItems.ITEM_SIGNS) {
for (ModItems sign : ModItems.OLD_SIGN_ITEMS) {
if (stack.getItem() == sign.get()) {
iterator.remove();
}
Expand All @@ -147,7 +145,7 @@ public void displayAllReleventItems(List list) {

//Add the sign items back but in a way so they are sorted by their block ID instead of their item ID.
//This allows them to be in the correct place instead of always at the bottom of the block ID list, since item IDs are always above block IDs
for (ModItems sign : ModItems.ITEM_SIGNS) {
for (ModItems sign : ModItems.OLD_SIGN_ITEMS) {
for (ItemStack stack : (List<ItemStack>) list) {
if (Item.getIdFromItem(stack.getItem()) > Block.getIdFromBlock(((ItemWoodSign) sign.get()).getSignBlock())) {
list.add(list.indexOf(stack), sign.newItemStack());
Expand Down Expand Up @@ -240,9 +238,9 @@ public void preInit(FMLPreInitializationEvent event) {
DynamicSoundsResourcePack.inject();
}

// if(ConfigurationHandler.enableNewNether) {
// NetherBiomeManager.init(); // Come back to
// }
if (ConfigWorld.netherDimensionProvider) {
NetherBiomeManager.init();
}

GameRegistry.registerWorldGenerator(EtFuturumWorldGenerator.INSTANCE, 0);
GameRegistry.registerWorldGenerator(EtFuturumLateWorldGenerator.INSTANCE, Integer.MAX_VALUE);
Expand Down Expand Up @@ -452,13 +450,12 @@ public void onLoadComplete(FMLLoadCompleteEvent e) {
//Block registry iterator
for (Block block : (Iterable<Block>) Block.blockRegistry) {
if (ConfigFunctions.enableHoeMining) {
/*
* HOE MINING
*/
if (block instanceof BlockLeaves || block instanceof BlockHay || block instanceof BlockSponge || block instanceof BlockNetherWart
|| block instanceof BlockSculk || block instanceof BlockSculkCatalyst) {
HoeRegistry.addToHoeArray(block);
}
HoeRegistry.addToHoeArray(ModBlocks.SHROOMLIGHT.get());
HoeRegistry.addToHoeArray(ModBlocks.SPONGE.get());
}

if (ConfigSounds.newBlockSounds) {
Expand All @@ -476,8 +473,9 @@ public void onLoadComplete(FMLLoadCompleteEvent e) {
}
}

// if(ConfigurationHandler.enableNewNether)
// DimensionProviderNether.init(); // Come back to
if (ConfigWorld.netherDimensionProvider && !hasNetherlicious) {
DimensionProviderEFRNether.init();
}

if (TESTING) {
DimensionProviderEFREnd.init(); // Come back to
Expand Down Expand Up @@ -590,6 +588,12 @@ public float getPitch(World world, int x, int y, int z, float pitch, MultiBlockS
mbs.setTypes(9, ModSounds.soundNetherWood);
MultiBlockSoundRegistry.multiBlockSounds.put(ModBlocks.DOUBLE_WOOD_SLAB.get(), mbs);
}

if (ModBlocks.PACKED_MUD.isEnabled()) {
BasicMultiBlockSound mbs = new BasicMultiBlockSound();
mbs.setTypes(1, ModSounds.soundMudBricks);
MultiBlockSoundRegistry.multiBlockSounds.put(ModBlocks.PACKED_MUD.get(), mbs);
}
}

/**
Expand Down
12 changes: 8 additions & 4 deletions src/main/java/ganymedes01/etfuturum/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,8 @@ public enum ModBlocks {

// Mud
// TODO: Change Packed Mud vs Mud Bricks Sound
MUD(ConfigBlocksItems.enableMud, new BlockMud()),
MUD(ConfigBlocksItems.enableMud, new BaseBlock(Material.ground).setBlockSound(ModSounds.soundMud).setNames("mud")
.setHardness(0.5F).setResistance(0.5F).setCreativeTab(EtFuturum.creativeTabBlocks)),
MUDDY_MANGROVE_ROOTS(ConfigBlocksItems.enableMud, new BlockMuddyMangroveRoots()),
PACKED_MUD(ConfigBlocksItems.enableMud, new BlockPackedMud()),

Expand Down Expand Up @@ -213,7 +214,7 @@ public enum ModBlocks {
.setBlockSound(ModSounds.soundDeepslateBricks).setHardness(3).setResistance(6)),
MUD_BRICK_SLAB(ConfigBlocksItems.enableMud, new BaseSlab(false, Material.rock, "mud_bricks").setNames("mud_brick_slab")
.setBlockSound(ModSounds.soundMudBricks).setHardness(3).setResistance(6)),
MUD_BRICK_SLAB_SLAB(ConfigBlocksItems.enableMud, new BaseSlab(true, Material.rock, "mud_bricks").setNames("mud_brick_slab")
DOUBLE_MUD_BRICK_SLAB(ConfigBlocksItems.enableMud, new BaseSlab(true, Material.rock, "mud_bricks").setNames("mud_brick_slab")
.setBlockSound(ModSounds.soundMudBricks).setHardness(3).setResistance(6)),
CUT_COPPER_STAIRS(ConfigBlocksItems.enableCopper, new BlockCutCopperStairs(4)),
EXPOSED_CUT_COPPER_STAIRS(ConfigBlocksItems.enableCopper, new BlockCutCopperStairs(5)),
Expand Down Expand Up @@ -255,15 +256,18 @@ public enum ModBlocks {
BEE_NEST(ConfigEntities.enableBees, new BlockBeeHive().setHiveType("bee_nest", true)),
CHAIN(ConfigBlocksItems.enableChain, new BlockChain()),

SOUL_SOIL(ConfigBlocksItems.enableSoulSoil, new BlockSoulSoil()),
SHROOMLIGHT(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BaseBlock(Material.gourd).setNames("shroomlight").setBlockSound(ModSounds.soundShroomlight)
.setResistance(1).setHardness(1).setLightLevel(1)),
NETHER_ROOTS(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BlockNetherRoots(), BaseSubtypesPotableItemBlock.class),
NETHER_FUNGUS(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BlockNetherFungus(), BaseSubtypesPotableItemBlock.class),
NETHER_SPROUTS(ConfigBlocksItems.enableWarpedBlocks, new BlockNetherSprouts()),
NETHER_WART(ConfigBlocksItems.enableNetherwartBlock || ConfigBlocksItems.enableWarpedBlocks, new BlockNetherwart()),
NYLIUM(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BlockNylium()),
CRIMSON_STEM(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BlockNetherStem("crimson")),
WARPED_STEM(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks, new BlockNetherStem("warped")),
WEEPING_VINS(ConfigBlocksItems.enableCrimsonBlocks, new BlockWeepingVines()),
TWISTING_VINS(ConfigBlocksItems.enableWarpedBlocks, new BlockTwistingVines()),
WEEPING_VINES(ConfigBlocksItems.enableCrimsonBlocks, new BlockWeepingVines()),
TWISTING_VINES(ConfigBlocksItems.enableWarpedBlocks, new BlockTwistingVines()),

WOOD_PLANKS(ConfigBlocksItems.enableCrimsonBlocks || ConfigBlocksItems.enableWarpedBlocks,
new BlockWoodPlanks()),
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/ganymedes01/etfuturum/ModItems.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public enum ModItems {

public static final ModItems[] CHEST_BOATS = new ModItems[]{OAK_CHEST_BOAT, SPRUCE_CHEST_BOAT, BIRCH_CHEST_BOAT, JUNGLE_CHEST_BOAT, ACACIA_CHEST_BOAT, DARK_OAK_CHEST_BOAT};
public static final ModItems[] BOATS = new ModItems[]{OAK_BOAT, SPRUCE_BOAT, BIRCH_BOAT, JUNGLE_BOAT, ACACIA_BOAT, DARK_OAK_BOAT};
public static final ModItems[] ITEM_SIGNS = new ModItems[]{ITEM_SIGN_SPRUCE, ITEM_SIGN_BIRCH, ITEM_SIGN_JUNGLE, ITEM_SIGN_ACACIA, ITEM_SIGN_DARK_OAK};
public static final ModItems[] OLD_SIGN_ITEMS = new ModItems[]{ITEM_SIGN_SPRUCE, ITEM_SIGN_BIRCH, ITEM_SIGN_JUNGLE, ITEM_SIGN_ACACIA, ITEM_SIGN_DARK_OAK};

/*
* Stand-in static final fields because some mods incorrectly referenced my code directly.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ public static void init() {
new ItemStack(Items.melon),
new ItemStack(Items.reeds),
new ItemStack(Blocks.double_plant, 1, 2),
new ItemStack(Blocks.vine)
new ItemStack(Blocks.vine),
ModBlocks.NETHER_ROOTS.newItemStack(1, OreDictionary.WILDCARD_VALUE),
ModBlocks.NETHER_SPROUTS.newItemStack(1, OreDictionary.WILDCARD_VALUE)
), 50);

registerCompostable(ImmutableList.of(
Expand All @@ -64,7 +66,9 @@ public static void init() {
new ItemStack(Items.nether_wart),
"cropPotato",
new ItemStack(Blocks.pumpkin),
"cropWheat"
"cropWheat",
ModBlocks.NETHER_FUNGUS.newItemStack(1, OreDictionary.WILDCARD_VALUE),
ModBlocks.SHROOMLIGHT.newItemStack()
), 65);

registerCompostable(ImmutableList.of(
Expand Down
16 changes: 12 additions & 4 deletions src/main/java/ganymedes01/etfuturum/api/StrippedLogRegistry.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,21 @@ public static void init() {
}

if (ModBlocks.CRIMSON_STEM.isEnabled()) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 0), new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 2));
strippedLogs.put(new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 1), new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 3));
if (ConfigBlocksItems.enableStrippedLogs) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 0), new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 2));
if (ConfigBlocksItems.enableBarkLogs) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 1), new RegistryMapping<>(ModBlocks.CRIMSON_STEM.get(), 3));
}
}
}

if (ModBlocks.WARPED_STEM.isEnabled()) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 0), new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 2));
strippedLogs.put(new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 1), new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 3));
if (ConfigBlocksItems.enableStrippedLogs) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 0), new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 2));
if (ConfigBlocksItems.enableBarkLogs) {
strippedLogs.put(new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 1), new RegistryMapping<>(ModBlocks.WARPED_STEM.get(), 3));
}
}
}
}
}
5 changes: 5 additions & 0 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockLight.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,11 @@ public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer p
return false;
}

@Override
public boolean isAir(IBlockAccess world, int x, int y, int z) {
return false;
}

@Override
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List p_149666_3_) {
for (int i = 0; i < 16; i++) {
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockMagma.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.minecraft.block.material.Material;
import net.minecraft.init.Blocks;
import net.minecraft.util.DamageSource;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;

Expand Down Expand Up @@ -45,4 +46,9 @@ public void randomDisplayTick(World world, int x, int y, int z, Random rand) {
world.spawnParticle("bubble", x + 0.5D, y + 1.1D, z + 0.5D, 0.0D, 1.0D, 0.0D);
}
}

@Override
public boolean getBlocksMovement(IBlockAccess p_149655_1_, int p_149655_2_, int p_149655_3_, int p_149655_4_) {
return true;
}
}
25 changes: 0 additions & 25 deletions src/main/java/ganymedes01/etfuturum/blocks/BlockMud.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.ModBlocks;
import ganymedes01.etfuturum.client.sound.ModSounds;
import ganymedes01.etfuturum.configuration.configs.ConfigBlocksItems;
import ganymedes01.etfuturum.core.utils.Utils;
import ganymedes01.etfuturum.world.generate.decorate.WorldGenHugeFungus;
import net.minecraft.block.Block;
import net.minecraft.block.BlockBush;
import net.minecraft.block.IGrowable;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Blocks;
Expand All @@ -16,12 +19,14 @@
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraft.world.gen.feature.WorldGenAbstractTree;
import net.minecraftforge.common.EnumPlantType;
import net.minecraftforge.common.util.ForgeDirection;

import java.util.List;
import java.util.Random;

public class BlockNetherFungus extends BlockBush implements ISubBlocksBlock {
public class BlockNetherFungus extends BlockBush implements ISubBlocksBlock, IGrowable {

private IIcon[] icons;
private final String[] types = new String[]{"crimson_fungus", "warped_fungus"};
Expand Down Expand Up @@ -95,4 +100,19 @@ public String[] getTypes() {
public String getNameFor(ItemStack stack) {
return getTypes()[stack.getItemDamage() % types.length];
}

public boolean func_149851_a(World world, int x, int y, int z, boolean p_149851_5_) {
return world.getBlock(x, y - 1, z) == ModBlocks.NYLIUM.get() && world.getBlockMetadata(x, y, z) == world.getBlockMetadata(x, y - 1, z);
}

public boolean func_149852_a(World p_149852_1_, Random p_149852_2_, int p_149852_3_, int p_149852_4_, int p_149852_5_) {
return (double) p_149852_1_.rand.nextFloat() < 0.40D;
}

public void func_149853_b(World world, Random rand, int x, int y, int z) {
boolean crimson = world.getBlockMetadata(x, y, z) == 0;
WorldGenAbstractTree fungus = new WorldGenHugeFungus(true, 0, crimson ? 0 : 1,
crimson ? ModBlocks.CRIMSON_STEM.get() : ModBlocks.WARPED_STEM.get(), ModBlocks.NETHER_WART.get(), true);
fungus.generate(world, rand, x, y, z);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ganymedes01.etfuturum.EtFuturum;
import ganymedes01.etfuturum.api.HoeRegistry;
import ganymedes01.etfuturum.client.sound.ModSounds;
import ganymedes01.etfuturum.configuration.configs.ConfigBlocksItems;
import ganymedes01.etfuturum.core.utils.Utils;
Expand All @@ -23,12 +24,13 @@ public BlockNetherwart() {
setBlockSound(ModSounds.soundWartBlock);
setNames("wart_block");
setCreativeTab(EtFuturum.creativeTabBlocks);
HoeRegistry.addToHoeArray(this);
}

@Override
@SideOnly(Side.CLIENT)
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
if (ConfigBlocksItems.enableCrimsonBlocks) {
if (ConfigBlocksItems.enableNetherwartBlock) {
list.add(new ItemStack(item, 1, 0));
}
if (ConfigBlocksItems.enableWarpedBlocks) {
Expand Down
Loading

0 comments on commit 250d6e3

Please sign in to comment.