Allowed BOP logs to be stripped (Closes #1394), and saplings/leaves/plants to be composted

This commit is contained in:
Forstride 2019-07-27 01:12:22 -04:00
parent 4e33f53f8a
commit 5ea3b0996e
18 changed files with 136 additions and 7 deletions

View File

@ -47,6 +47,7 @@ public class BiomesOPlenty
ModBlocks.init();
ModItems.init();
ModBiomes.init();
ModVanillaCompat.init();
}
public void dedicatedServerSetup(FMLDedicatedServerSetupEvent event)

View File

@ -17,6 +17,7 @@ import net.minecraft.block.material.Material;
import net.minecraft.block.material.MaterialColor;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.util.IItemProvider;
import net.minecraft.util.SoundEvents;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.registries.ForgeRegistries;
@ -290,6 +291,8 @@ public class ModBlocks
toadstool = registerBlock(new MushroomBlockBOP(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().zeroHardnessAndResistance().sound(SoundType.PLANT)), "toadstool");
glowshroom = registerBlock(new MushroomBlockBOP(Block.Properties.create(Material.PLANTS).doesNotBlockMovement().zeroHardnessAndResistance().sound(SoundType.PLANT).lightValue(6)), "glowshroom");
}
public static Block registerBlock(Block block, String name)
@ -302,17 +305,15 @@ public class ModBlocks
return block;
}
public static Block registerBlock(Block block, BlockItem itemBlock, String name)
{
public static Block registerBlock(Block block, BlockItem itemBlock, String name) {
block.setRegistryName(name);
ForgeRegistries.BLOCKS.register(block);
if (itemBlock != null)
{
if (itemBlock != null) {
itemBlock.setRegistryName(name);
ForgeRegistries.ITEMS.register(itemBlock);
ForgeRegistries.ITEMS.register(itemBlock);
}
return block;
}
}

View File

@ -7,9 +7,11 @@
******************************************************************************/
package biomesoplenty.init;
import biomesoplenty.api.block.BOPBlocks;
import biomesoplenty.api.sound.BOPSounds;
import biomesoplenty.common.item.MusicDiscItemBOP;
import biomesoplenty.common.util.inventory.ItemGroupBOP;
import net.minecraft.item.AxeItem;
import net.minecraft.item.Item;
import net.minecraftforge.registries.ForgeRegistries;

View File

@ -0,0 +1,123 @@
package biomesoplenty.init;
import biomesoplenty.api.block.BOPBlocks;
import com.google.common.collect.Maps;
import net.minecraft.block.Block;
import net.minecraft.block.ComposterBlock;
import net.minecraft.item.AxeItem;
import net.minecraft.util.IItemProvider;
public class ModVanillaCompat
{
public static void init()
{
//Log Stripping
registerStrippable(BOPBlocks.fir_log, BOPBlocks.stripped_fir_log);
registerStrippable(BOPBlocks.fir_wood, BOPBlocks.stripped_fir_wood);
registerStrippable(BOPBlocks.redwood_log, BOPBlocks.stripped_redwood_log);
registerStrippable(BOPBlocks.redwood_wood, BOPBlocks.stripped_redwood_wood);
registerStrippable(BOPBlocks.cherry_log, BOPBlocks.stripped_cherry_log);
registerStrippable(BOPBlocks.cherry_wood, BOPBlocks.stripped_cherry_wood);
registerStrippable(BOPBlocks.mahogany_log, BOPBlocks.stripped_mahogany_log);
registerStrippable(BOPBlocks.mahogany_wood, BOPBlocks.stripped_mahogany_wood);
registerStrippable(BOPBlocks.jacaranda_log, BOPBlocks.stripped_jacaranda_log);
registerStrippable(BOPBlocks.jacaranda_wood, BOPBlocks.stripped_jacaranda_wood);
registerStrippable(BOPBlocks.palm_log, BOPBlocks.stripped_palm_log);
registerStrippable(BOPBlocks.palm_wood, BOPBlocks.stripped_palm_wood);
registerStrippable(BOPBlocks.willow_log, BOPBlocks.stripped_willow_log);
registerStrippable(BOPBlocks.willow_wood, BOPBlocks.stripped_willow_wood);
registerStrippable(BOPBlocks.dead_log, BOPBlocks.stripped_dead_log);
registerStrippable(BOPBlocks.dead_wood, BOPBlocks.stripped_dead_wood);
registerStrippable(BOPBlocks.magic_log, BOPBlocks.stripped_magic_log);
registerStrippable(BOPBlocks.magic_wood, BOPBlocks.stripped_magic_wood);
registerStrippable(BOPBlocks.umbran_log, BOPBlocks.stripped_umbran_log);
registerStrippable(BOPBlocks.umbran_wood, BOPBlocks.stripped_umbran_wood);
registerStrippable(BOPBlocks.hellbark_log, BOPBlocks.stripped_hellbark_log);
registerStrippable(BOPBlocks.hellbark_wood, BOPBlocks.stripped_hellbark_wood);
registerStrippable(BOPBlocks.ethereal_log, BOPBlocks.stripped_ethereal_log);
registerStrippable(BOPBlocks.ethereal_wood, BOPBlocks.stripped_ethereal_wood);
//Compostable Blocks
registerCompostable(0.3F, BOPBlocks.origin_sapling);
registerCompostable(0.3F, BOPBlocks.origin_leaves);
registerCompostable(0.3F, BOPBlocks.flowering_oak_sapling);
registerCompostable(0.3F, BOPBlocks.flowering_oak_leaves);
registerCompostable(0.3F, BOPBlocks.yellow_autumn_sapling);
registerCompostable(0.3F, BOPBlocks.yellow_autumn_leaves);
registerCompostable(0.3F, BOPBlocks.orange_autumn_sapling);
registerCompostable(0.3F, BOPBlocks.orange_autumn_leaves);
registerCompostable(0.3F, BOPBlocks.maple_sapling);
registerCompostable(0.3F, BOPBlocks.maple_leaves);
registerCompostable(0.3F, BOPBlocks.fir_sapling);
registerCompostable(0.3F, BOPBlocks.fir_leaves);
registerCompostable(0.3F, BOPBlocks.redwood_sapling);
registerCompostable(0.3F, BOPBlocks.redwood_leaves);
registerCompostable(0.3F, BOPBlocks.white_cherry_sapling);
registerCompostable(0.3F, BOPBlocks.white_cherry_leaves);
registerCompostable(0.3F, BOPBlocks.pink_cherry_sapling);
registerCompostable(0.3F, BOPBlocks.pink_cherry_leaves);
registerCompostable(0.3F, BOPBlocks.mahogany_sapling);
registerCompostable(0.3F, BOPBlocks.mahogany_leaves);
registerCompostable(0.3F, BOPBlocks.jacaranda_sapling);
registerCompostable(0.3F, BOPBlocks.jacaranda_leaves);
registerCompostable(0.3F, BOPBlocks.palm_sapling);
registerCompostable(0.3F, BOPBlocks.palm_leaves);
registerCompostable(0.3F, BOPBlocks.willow_sapling);
registerCompostable(0.3F, BOPBlocks.willow_leaves);
registerCompostable(0.3F, BOPBlocks.dead_sapling);
registerCompostable(0.3F, BOPBlocks.dead_leaves);
registerCompostable(0.3F, BOPBlocks.magic_sapling);
registerCompostable(0.3F, BOPBlocks.magic_leaves);
registerCompostable(0.3F, BOPBlocks.umbran_sapling);
registerCompostable(0.3F, BOPBlocks.umbran_leaves);
registerCompostable(0.3F, BOPBlocks.hellbark_sapling);
registerCompostable(0.3F, BOPBlocks.hellbark_leaves);
registerCompostable(0.3F, BOPBlocks.ethereal_sapling);
registerCompostable(0.3F, BOPBlocks.ethereal_leaves);
registerCompostable(0.65F, BOPBlocks.rose);
registerCompostable(0.65F, BOPBlocks.blue_hydrangea);
registerCompostable(0.65F, BOPBlocks.violet);
registerCompostable(0.65F, BOPBlocks.lavender);
registerCompostable(0.65F, BOPBlocks.goldenrod);
registerCompostable(0.65F, BOPBlocks.wildflower);
registerCompostable(0.65F, BOPBlocks.orange_cosmos);
registerCompostable(0.65F, BOPBlocks.pink_daffodil);
registerCompostable(0.65F, BOPBlocks.pink_hibiscus);
registerCompostable(0.65F, BOPBlocks.glowflower);
registerCompostable(0.65F, BOPBlocks.wilted_lily);
registerCompostable(0.65F, BOPBlocks.burning_blossom);
registerCompostable(0.5F, BOPBlocks.willow_vine);
registerCompostable(0.5F, BOPBlocks.bush);
registerCompostable(0.5F, BOPBlocks.barley);
registerCompostable(0.5F, BOPBlocks.dune_grass);
registerCompostable(0.5F, BOPBlocks.desert_grass);
registerCompostable(0.5F, BOPBlocks.dead_grass);
registerCompostable(0.5F, BOPBlocks.spectral_fern);
registerCompostable(0.5F, BOPBlocks.cattail);
registerCompostable(0.5F, BOPBlocks.tall_cattail);
registerCompostable(0.5F, BOPBlocks.reed);
registerCompostable(0.5F, BOPBlocks.watergrass);
registerCompostable(0.5F, BOPBlocks.mangrove_root);
registerCompostable(0.5F, BOPBlocks.bramble);
registerCompostable(0.65F, BOPBlocks.toadstool);
registerCompostable(0.65F, BOPBlocks.glowshroom);
}
public static void registerStrippable(Block log, Block stripped_log)
{
AxeItem.BLOCK_STRIPPING_MAP = Maps.newHashMap(AxeItem.BLOCK_STRIPPING_MAP);
AxeItem.BLOCK_STRIPPING_MAP.put(log, stripped_log);
}
public static void registerCompostable(float chance, IItemProvider itemIn)
{
ComposterBlock.CHANCES.put(itemIn.asItem(), chance);
}
}

View File

@ -11,6 +11,8 @@ public net.minecraft.block.TrapDoorBlock <init>(Lnet/minecraft/block/Block$Prope
public net.minecraft.block.WoodButtonBlock <init>(Lnet/minecraft/block/Block$Properties;)V # WoodButtonBlock
public net.minecraft.block.PressurePlateBlock <init>(Lnet/minecraft/block/PressurePlateBlock$Sensitivity;Lnet/minecraft/block/Block$Properties;)V # PressurePlateBlock
public-f net.minecraft.item.AxeItem field_203176_a # BLOCK_STRIPPING_MAP
# server.properties world type hackery
public-f net.minecraft.server.dedicated.ServerProperties *
public net.minecraft.server.dedicated.PropertyManager *

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B