Skip to content

Commit

Permalink
Updated to 0.6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-MacLean committed Apr 22, 2021
1 parent 22835fd commit 964ac14
Show file tree
Hide file tree
Showing 12 changed files with 107 additions and 118 deletions.
11 changes: 7 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,15 @@ java.toolchain.languageVersion = JavaLanguageVersion.of(8)
println('Java: ' + System.getProperty('java.version') + ' JVM: ' + System.getProperty('java.vm.version') + '(' + System.getProperty('java.vendor') + ') Arch: ' + System.getProperty('os.arch'))
minecraft {
mappings channel: mappingsChannel, version: mappingsVersion
//makeObfSourceJar = false
// makeObfSourceJar = false
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'

mods {
herobrine {
source sourceSets.main
Expand All @@ -38,7 +40,7 @@ minecraft {
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
mods {
herobrine {
source sourceSets.main
Expand All @@ -51,6 +53,7 @@ minecraft {
property 'forge.logging.markers', 'REGISTRIES'
property 'forge.logging.console.level', 'debug'
args '--mod', modId, '--all', '--output', file('src/generated/resources/'), '--existing', file('src/main/resources/')

mods {
herobrine {
source sourceSets.main
Expand Down Expand Up @@ -81,7 +84,7 @@ jar {
}
}

jar.finalizedBy('reobfJar')
jar.finalizedBy('reobfJar')
//publish.dependsOn('reobfJar')

publishing {
Expand All @@ -95,4 +98,4 @@ publishing {
url "file:///${project.projectDir}/mcmodsrepo"
}
}
}
}
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false

modVersion = 0.6.0
modVersion = 0.6.1
modMinecraftVersion = 1.16.5
modForgeVersion = 36.1.4
modForgeVersion = 36.1.6
mappingsChannel = snapshot
mappingsVersion = 20201028-1.16.3
modId = herobrine
Expand Down
142 changes: 70 additions & 72 deletions src/main/java/com/herobrine/mod/HerobrineMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import com.herobrine.mod.items.HolyWaterItem;
import com.herobrine.mod.items.UnholyWaterItem;
import com.herobrine.mod.savedata.HerobrineSaveData;
import com.herobrine.mod.util.blocks.BlockList;
import com.herobrine.mod.util.entities.DefaultSurvivorSkins;
import com.herobrine.mod.util.entities.EntityRegistry;
import com.herobrine.mod.util.items.ArmorMaterialList;
Expand Down Expand Up @@ -64,81 +65,78 @@ private void init(FMLCommonSetupEvent event) {
DefaultSurvivorSkins.registerDefaultSkins();
}

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
public static void registerItems(@NotNull final RegistryEvent.Register<Item> event) {
assert false;
event.getRegistry().registerAll(
new BlockItem(HerobrineAltar.block, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("herobrine_altar")),
new BlockItem(CursedDiamondBlock.block, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("cursed_diamond_block")),
new HerobrineStatueItem(HerobrineStatue.block, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("herobrine_statue")),
new BlockItem(PurifiedDiamondBlock.block, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("purified_diamond_block")),
ItemList.bedrock_sword = new SwordItem(ItemTierList.bedrock_item_tier, 0, -2.4f, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("bedrock_sword")),
ItemList.cursed_diamond = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("cursed_diamond")),
ItemList.cursed_diamond_sword = new SwordItem(ItemTierList.cursed_diamond_item_tier, 3, -2.4f, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_sword")),
ItemList.cursed_diamond_axe = new AxeItem(ItemTierList.cursed_diamond_item_tier, 5, -3.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_axe")),
ItemList.cursed_diamond_pickaxe = new PickaxeItem(ItemTierList.cursed_diamond_item_tier, 1, -2.8f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_pickaxe")),
ItemList.cursed_diamond_shovel = new ShovelItem(ItemTierList.cursed_diamond_item_tier, 1.5f, -3.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_shovel")),
ItemList.cursed_diamond_hoe = new HoeItem(ItemTierList.cursed_diamond_item_tier, -4,0.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_hoe")),
ItemList.cursed_diamond_helmet = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.HEAD, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_helmet")),
ItemList.cursed_diamond_chestplate = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.CHEST, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_chestplate")),
ItemList.cursed_diamond_leggings = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.LEGS, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_leggings")),
ItemList.cursed_diamond_boots = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.FEET, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_boots")),
ItemList.cursed_dust = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("cursed_dust")),
ItemList.holy_water = new HolyWaterItem(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("holy_water")),
ItemList.unholy_water = new UnholyWaterItem(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("unholy_water")),
ItemList.purified_diamond = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("purified_diamond")),
ItemList.music_disc_dog = new MusicDiscItem(14, () -> new SoundEvent(HerobrineMod.location("music_disc_dog")), new Item.Properties().maxStackSize(1).group(ItemGroup.MISC).rarity(Rarity.RARE)).setRegistryName(location("music_disc_dog"))
);
EntityRegistry.registerEntitySpawnEggs(event);
}
@SubscribeEvent
public static void registerItems(@NotNull final RegistryEvent.Register<Item> event) {
assert false;
event.getRegistry().registerAll(
ItemList.herobrine_altar = new BlockItem(BlockList.herobrine_altar, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("herobrine_altar")),
ItemList.cursed_diamond_block = new BlockItem(BlockList.cursed_diamond_block, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("cursed_diamond_block")),
ItemList.herobrine_statue = new HerobrineStatueItem(BlockList.herobrine_statue, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("herobrine_statue")),
ItemList.purified_diamond_block = new BlockItem(BlockList.herobrine_statue_top, new Item.Properties().group(ItemGroup.DECORATIONS)).setRegistryName(location("purified_diamond_block")),
ItemList.bedrock_sword = new SwordItem(ItemTierList.bedrock_item_tier, 0, -2.4f, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("bedrock_sword")),
ItemList.cursed_diamond = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("cursed_diamond")),
ItemList.cursed_diamond_sword = new SwordItem(ItemTierList.cursed_diamond_item_tier, 3, -2.4f, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_sword")),
ItemList.cursed_diamond_axe = new AxeItem(ItemTierList.cursed_diamond_item_tier, 5, -3.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_axe")),
ItemList.cursed_diamond_pickaxe = new PickaxeItem(ItemTierList.cursed_diamond_item_tier, 1, -2.8f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_pickaxe")),
ItemList.cursed_diamond_shovel = new ShovelItem(ItemTierList.cursed_diamond_item_tier, 1.5f, -3.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_shovel")),
ItemList.cursed_diamond_hoe = new HoeItem(ItemTierList.cursed_diamond_item_tier, -4,0.0f, new Item.Properties().group(ItemGroup.TOOLS)).setRegistryName(location("cursed_diamond_hoe")),
ItemList.cursed_diamond_helmet = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.HEAD, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_helmet")),
ItemList.cursed_diamond_chestplate = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.CHEST, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_chestplate")),
ItemList.cursed_diamond_leggings = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.LEGS, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_leggings")),
ItemList.cursed_diamond_boots = new ArmorItem(ArmorMaterialList.cursed_diamond_armor_material, EquipmentSlotType.FEET, new Item.Properties().group(ItemGroup.COMBAT)).setRegistryName(location("cursed_diamond_boots")),
ItemList.cursed_dust = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("cursed_dust")),
ItemList.holy_water = new HolyWaterItem(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("holy_water")),
ItemList.unholy_water = new UnholyWaterItem(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("unholy_water")),
ItemList.purified_diamond = new Item(new Item.Properties().group(ItemGroup.MISC)).setRegistryName(location("purified_diamond")),
ItemList.music_disc_dog = new MusicDiscItem(14, () -> new SoundEvent(HerobrineMod.location("music_disc_dog")), new Item.Properties().maxStackSize(1).group(ItemGroup.MISC).rarity(Rarity.RARE)).setRegistryName(location("music_disc_dog"))
);
EntityRegistry.registerEntitySpawnEggs(event);
}

@SubscribeEvent
public static void registerBlocks(@NotNull final RegistryEvent.Register<Block> event) {
event.getRegistry().registerAll(
new HerobrineAltar(),
new CursedDiamondBlock(),
new HerobrineStatue(),
new HerobrineStatueTop(),
new PurifiedDiamondBlock()
);
}
@SubscribeEvent
public static void registerBlocks(@NotNull final RegistryEvent.Register<Block> event) {
event.getRegistry().registerAll(
BlockList.herobrine_altar = new HerobrineAltar().setRegistryName(location("herobrine_altar")),
BlockList.cursed_diamond_block = new CursedDiamondBlock().setRegistryName(location("cursed_diamond_block")),
BlockList.herobrine_statue = new HerobrineStatue().setRegistryName(location("herobrine_statue")),
BlockList.herobrine_statue_top = new HerobrineStatueTop().setRegistryName(location("herobrine_statue_top")),
BlockList.purified_diamond_block = new PurifiedDiamondBlock().setRegistryName(location("purified_diamond_block"))
);
}

@SubscribeEvent
public static void registerEntities(@NotNull final RegistryEvent.Register<EntityType<?>> event) {
event.getRegistry().registerAll(
EntityRegistry.HEROBRINE_WARRIOR_ENTITY,
EntityRegistry.INFECTED_PIG_ENTITY,
EntityRegistry.INFECTED_CHICKEN_ENTITY,
EntityRegistry.INFECTED_SHEEP_ENTITY,
EntityRegistry.INFECTED_COW_ENTITY,
EntityRegistry.INFECTED_MOOSHROOM_ENTITY,
EntityRegistry.INFECTED_VILLAGER_ENTITY,
EntityRegistry.HEROBRINE_SPY_ENTITY,
EntityRegistry.HEROBRINE_BUILDER_ENTITY,
EntityRegistry.HEROBRINE_MAGE_ENTITY,
EntityRegistry.FAKE_HEROBRINE_MAGE_ENTITY,
EntityRegistry.HOLY_WATER_ENTITY,
EntityRegistry.UNHOLY_WATER_ENTITY,
EntityRegistry.STEVE_SURVIVOR_ENTITY,
EntityRegistry.ALEX_SURVIVOR_ENTITY,
EntityRegistry.INFECTED_WOLF_ENTITY,
EntityRegistry.INFECTED_LLAMA_ENTITY,
EntityRegistry.INFECTED_HORSE_ENTITY,
EntityRegistry.INFECTED_DONKEY_ENTITY,
EntityRegistry.INFECTED_RABBIT_ENTITY,
EntityRegistry.INFECTED_BAT_ENTITY,
EntityRegistry.HEROBRINE_STALKER_ENTITY
);
EntityRegistry.registerSpawnPlacement();
EntityRegistry.registerEntityAttributes();
}
@SubscribeEvent
public static void registerEntities(@NotNull final RegistryEvent.Register<EntityType<?>> event) {
event.getRegistry().registerAll(
EntityRegistry.HEROBRINE_WARRIOR_ENTITY,
EntityRegistry.INFECTED_PIG_ENTITY,
EntityRegistry.INFECTED_CHICKEN_ENTITY,
EntityRegistry.INFECTED_SHEEP_ENTITY,
EntityRegistry.INFECTED_COW_ENTITY,
EntityRegistry.INFECTED_MOOSHROOM_ENTITY,
EntityRegistry.INFECTED_VILLAGER_ENTITY,
EntityRegistry.HEROBRINE_SPY_ENTITY,
EntityRegistry.HEROBRINE_BUILDER_ENTITY,
EntityRegistry.HEROBRINE_MAGE_ENTITY,
EntityRegistry.FAKE_HEROBRINE_MAGE_ENTITY,
EntityRegistry.HOLY_WATER_ENTITY,
EntityRegistry.UNHOLY_WATER_ENTITY,
EntityRegistry.STEVE_SURVIVOR_ENTITY,
EntityRegistry.ALEX_SURVIVOR_ENTITY,
EntityRegistry.INFECTED_WOLF_ENTITY,
EntityRegistry.INFECTED_LLAMA_ENTITY,
EntityRegistry.INFECTED_HORSE_ENTITY,
EntityRegistry.INFECTED_DONKEY_ENTITY,
EntityRegistry.INFECTED_RABBIT_ENTITY,
EntityRegistry.INFECTED_BAT_ENTITY,
EntityRegistry.HEROBRINE_STALKER_ENTITY
);
EntityRegistry.registerSpawnPlacement();
EntityRegistry.registerEntityAttributes();
}

@SubscribeEvent
public static void registerBiomes(@NotNull final RegistryEvent.Register<Biome> event) {
BiomeInit.registerBiomes();
}
@SubscribeEvent
public static void registerBiomes(@NotNull final RegistryEvent.Register<Biome> event) {
BiomeInit.registerBiomes();
}

public void onWorldLoaded(WorldEvent.Load event) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.herobrine.mod.blocks;

import com.herobrine.mod.HerobrineMod;
import com.herobrine.mod.util.blocks.BlockMaterialList;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
Expand All @@ -12,18 +11,13 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.registries.ObjectHolder;
import org.jetbrains.annotations.NotNull;

import java.util.Random;

public class CursedDiamondBlock extends Block {
@ObjectHolder(HerobrineMod.MODID + ":cursed_diamond_block")
public static final Block block = null;

public CursedDiamondBlock() {
super(Properties.create(BlockMaterialList.CURSED_DIAMOND_BLOCK_MATERIAL).hardnessAndResistance(1.5F).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(1));
setRegistryName("cursed_diamond_block");
}

@OnlyIn(Dist.CLIENT)
Expand Down
16 changes: 4 additions & 12 deletions src/main/java/com/herobrine/mod/blocks/HerobrineAltar.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.herobrine.mod.blocks;

import com.herobrine.mod.HerobrineMod;
import com.herobrine.mod.config.Config;
import com.herobrine.mod.util.blocks.BlockMaterialList;
import com.herobrine.mod.util.blocks.ModBlockStates;
Expand Down Expand Up @@ -37,20 +36,19 @@
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.common.ToolType;
import net.minecraftforge.registries.ObjectHolder;
import org.jetbrains.annotations.NotNull;

import javax.annotation.Nullable;
import java.util.Random;
import java.util.UUID;

import static com.herobrine.mod.HerobrineMod.location;

public class HerobrineAltar extends Block implements IWaterLoggable {
@ObjectHolder(HerobrineMod.MODID + ":herobrine_altar")
public static final Block block = null;
public static final VoxelShape SHAPE = VoxelShapes.or(Block.makeCuboidShape(0.0D, 0.0D, 0.0D, 16.0D, 8.0D, 16.0D), Block.makeCuboidShape(0.0D, 9.0D, 0.0D, 1.0D, 15.0D, 1.0D), Block.makeCuboidShape(16.0D, 9.0D, 0.0D, 15.0D, 15.0D, 1.0D), Block.makeCuboidShape(16.0D, 9.0D, 16.0D, 15.0D, 15.0D, 15.0D), Block.makeCuboidShape(0.0D, 9.0D, 16.0D, 1.0D, 15.0D, 15.0D), Block.makeCuboidShape(0.0D, 15.0D, 0.0D, 2.0D, 16.0D, 2.0D), Block.makeCuboidShape(14.0D, 15.0D, 0.0D, 16.0D, 16.0D, 2.0D), Block.makeCuboidShape(14.0D, 15.0D, 14.0D, 16.0D, 16.0D, 16.0D), Block.makeCuboidShape(0.0D, 15.0D, 14.0D, 2.0D, 16.0D, 16.0D), Block.makeCuboidShape(0.0D, 8.0D, 0.0D, 2.0D, 9.0D, 2.0D), Block.makeCuboidShape(14.0D, 8.0D, 0.0D, 16.0D, 9.0D, 2.0D), Block.makeCuboidShape(14.0D, 8.0D, 14.0D, 16.0D, 9.0D, 16.0D), Block.makeCuboidShape(0.0D, 8.0D, 14.0D, 2.0D, 9.0D, 16.0D));
public static final BooleanProperty WATERLOGGED = BlockStateProperties.WATERLOGGED;
public HerobrineAltar() {
super(Properties.create(BlockMaterialList.HEROBRINE_ALTER_MATERIAL).hardnessAndResistance(1.5F).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(0).notSolid().variableOpacity().setLightLevel(HerobrineAltar::getLightValue).setAllowsSpawn(HerobrineAltar::neverAllowSpawn));
this.setDefaultState(this.getDefaultState().with(BlockStateProperties.WATERLOGGED, Boolean.FALSE).with(ModBlockStates.TYPE, 0));
}

private static int getLightValue(BlockState state) {
int i = state.get(ModBlockStates.TYPE);
Expand All @@ -67,12 +65,6 @@ private static Boolean neverAllowSpawn(BlockState state, IBlockReader reader, Bl
return false;
}

public HerobrineAltar() {
super(Properties.create(BlockMaterialList.HEROBRINE_ALTER_MATERIAL).hardnessAndResistance(1.5F).sound(SoundType.METAL).harvestTool(ToolType.PICKAXE).harvestLevel(0).notSolid().variableOpacity().setLightLevel(HerobrineAltar::getLightValue).setAllowsSpawn(HerobrineAltar::neverAllowSpawn));
this.setDefaultState(this.getDefaultState().with(BlockStateProperties.WATERLOGGED, Boolean.FALSE).with(ModBlockStates.TYPE, 0));
setRegistryName(location("herobrine_altar"));
}

@NotNull
@Override
public VoxelShape getShape(@NotNull BlockState state, @NotNull IBlockReader worldIn, @NotNull BlockPos pos, @NotNull ISelectionContext context) {
Expand Down
Loading

0 comments on commit 964ac14

Please sign in to comment.