Skip to content

Commit

Permalink
1.20.1 Update Part 1
Browse files Browse the repository at this point in the history
  • Loading branch information
weirtz committed Aug 2, 2023
1 parent ec41e29 commit 683869b
Show file tree
Hide file tree
Showing 109 changed files with 1,232 additions and 4,226 deletions.
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,6 @@ A mod that introduces magic into Minecraft in amazing ways.
### Current features
* Mana bar
* Grow Budding Amethyst Blocks with Amethyst Block and Star Dust
* Use stars as fuel source in furnace.
* Amethyst Magic in fire creates wild magic

### Vanilla Integrations
* Buttercup flower in flower pot
* Lemonbalm plant in flower pot

### Current events
* Falling Stars
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ minecraft_version=1.20.1
# as they do not follow standard versioning conventions.
minecraft_version_range=[1.20.1,1.21)
# The Forge version must agree with the Minecraft version to get a valid artifact
forge_version=47.1.43
forge_version=47.1.0
# The Forge version range can use any version of Forge as bounds or match the loader version range
forge_version_range=[47,)
# The loader version range can only use the major version of Forge/FML as bounds
Expand Down Expand Up @@ -42,18 +42,18 @@ mapping_version=1.20.1

# The unique mod identifier for the mod. Must be lowercase in English locale. Must fit the regex [a-z][a-z0-9_]{1,63}
# Must match the String constant located in the main mod class annotated with @Mod.
mod_id=mana
mod_id=examplemod
# The human-readable display name for the mod.
mod_name=Mana Mod
mod_name=Example Mod
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=0.0.6
mod_version=1.0.0
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
mod_group_id=com.seabreyh.mana
mod_group_id=com.example.examplemod
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=Seabreyh
mod_authors=YourNameHere, OtherNameHere
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=A mod that introduces magic into Minecraft in amazing ways.
mod_description=Example mod description.\nNewline characters can be used and will be replaced properly.
23 changes: 0 additions & 23 deletions src/main/java/com/seabreyh/mana/ClientProxy.java

This file was deleted.

16 changes: 0 additions & 16 deletions src/main/java/com/seabreyh/mana/CommonProxy.java

This file was deleted.

49 changes: 29 additions & 20 deletions src/main/java/com/seabreyh/mana/ManaMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,26 @@

import com.mojang.logging.LogUtils;
import com.seabreyh.mana.event.ManaClientEvents;

import com.seabreyh.mana.gui.ManaMenuTypes;
import com.seabreyh.mana.networking.ManaMessages;
import com.seabreyh.mana.registry.ManaBlockEntities;
import com.seabreyh.mana.registry.ManaBlocks;
// import com.seabreyh.mana.event.ManaClientEvents;
import com.seabreyh.mana.registry.ManaCreativeTab;
import com.seabreyh.mana.registry.ManaEntities;
// import com.seabreyh.mana.gui.ManaMenuTypes;
// import com.seabreyh.mana.networking.ManaMessages;
// import com.seabreyh.mana.registry.ManaBlockEntities;
// import com.seabreyh.mana.registry.ManaBlocks;
// import com.seabreyh.mana.registry.ManaCreativeTab;
// import com.seabreyh.mana.registry.ManaEntities;
import com.seabreyh.mana.registry.ManaItems;
// import com.seabreyh.mana.registry.ManaParticles;
// import com.seabreyh.mana.registry.ManaPotions;
// import com.seabreyh.mana.registry.ManaRecipes;
// import com.seabreyh.mana.registry.ManaSounds;
import com.seabreyh.mana.registry.ManaParticles;
import com.seabreyh.mana.registry.ManaPotions;
import com.seabreyh.mana.registry.ManaRecipes;
import com.seabreyh.mana.registry.ManaSounds;

import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.CreativeModeTabs;
import net.minecraft.world.item.crafting.RecipeSerializer;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
Expand All @@ -29,6 +35,7 @@
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.event.BuildCreativeModeTabContentsEvent;
import net.minecraftforge.event.server.ServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.slf4j.Logger;
Expand All @@ -37,24 +44,25 @@
@Mod(ManaMod.MOD_ID)
public class ManaMod {
public static final String MOD_ID = "mana";
public static CreativeModeTab TAB = new ManaCreativeTab();
public static CommonProxy PROXY = DistExecutor.runForDist(() -> ClientProxy::new, () -> CommonProxy::new);
// public static CommonProxy PROXY = DistExecutor.runForDist(() ->
// ClientProxy::new, () -> CommonProxy::new);
public static final Logger LOGGER = LogUtils.getLogger();

public ManaMod() {

// Register items
IEventBus eventBus = FMLJavaModLoadingContext.get().getModEventBus();

ManaItems.ITEMS.register(eventBus);
ManaItems.register(eventBus);
ManaCreativeTab.register(eventBus);
ManaEntities.ENTITIES.register(eventBus);
ManaParticles.PARTICLE_TYPES.register(eventBus);
ManaSounds.SOUND_EVENTS.register(eventBus);
// ManaSounds.SOUND_EVENTS.register(eventBus);

ManaBlocks.register(eventBus);
ManaBlockEntities.register(eventBus);
ManaMenuTypes.register(eventBus);
ManaRecipes.register(eventBus);
// ManaBlockEntities.register(eventBus);
// ManaMenuTypes.register(eventBus);
// ManaRecipes.register(eventBus);

// Add listeners
eventBus.addListener(this::setup);
Expand All @@ -63,7 +71,8 @@ public ManaMod() {
// Register ourselves for server and other game events we are interested in
MinecraftForge.EVENT_BUS.register(this);

PROXY.init();
// eventBus.addListener(this::addCreative);
// PROXY.init();
}

private void setup(final FMLCommonSetupEvent event) {
Expand All @@ -77,16 +86,16 @@ private void setup(final FMLCommonSetupEvent event) {
((FlowerPotBlock) Blocks.FLOWER_POT).addPlant(ManaBlocks.PLANT_LEMONBALM.getId(),
ManaBlocks.POTTED_PLANT_LEMONBALM);

ManaPotions.registerRecipes();
// ManaPotions.registerRecipes();

});

}

@SubscribeEvent
// @SubscribeEvent
// UPDATED
public static void registerRecipes(RegisterEvent.RegisterHelper<RecipeSerializer<?>> event) {
ManaPotions.registerRecipes();
// ManaPotions.registerRecipes();
}

private void clientSetup(final FMLClientSetupEvent event) {
Expand All @@ -96,19 +105,19 @@ private void clientSetup(final FMLClientSetupEvent event) {
ManaClientEvents.registerOverlays(event);
ManaClientEvents.registerMenuScreens(/* no event pls */);

PROXY.clientInit();
// PROXY.clientInit();
}

// You can use SubscribeEvent and let the Event Bus discover methods to call
@SubscribeEvent
// @SubscribeEvent
public void onServerStarting(ServerStartingEvent event) {
// Do something when the server starts
// LOGGER.info("HELLO from server starting");
}

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public static class RegistryEvents {
@SubscribeEvent
// @SubscribeEvent
// UPDATED
public static void onBlocksRegistry(final RegisterEvent.RegisterHelper<Block> blockRegistryEvent) {
// Register a new block here
Expand Down
18 changes: 14 additions & 4 deletions src/main/java/com/seabreyh/mana/blocks/AmethystBlock.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
package com.seabreyh.mana.blocks;

import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.world.level.block.state.BlockBehaviour;
import net.minecraft.world.level.material.PushReaction;

public class AmethystBlock extends Block {

public AmethystBlock(BlockBehaviour.Properties p_55140_) {
super(p_55140_);
}
}
public AmethystBlock() {
this(Properties.of()
.sound(SoundType.METAL)
.requiresCorrectToolForDrops()
.strength(5.0F, 6.0F));
}

public AmethystBlock(BlockBehaviour.Properties properties) {
super(properties);
}
}
16 changes: 14 additions & 2 deletions src/main/java/com/seabreyh/mana/blocks/CelestialTorch.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.SimpleWaterloggedBlock;
import net.minecraft.world.level.block.SoundType;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.core.particles.ParticleTypes;
import net.minecraft.world.item.context.BlockPlaceContext;
import net.minecraft.world.level.BlockGetter;
import net.minecraft.world.level.Level;
Expand All @@ -23,6 +25,7 @@
import net.minecraft.world.level.block.state.properties.IntegerProperty;
import net.minecraft.world.level.material.FluidState;
import net.minecraft.world.level.material.Fluids;
import net.minecraft.world.level.material.PushReaction;
import net.minecraft.world.phys.shapes.CollisionContext;
import net.minecraft.world.phys.shapes.VoxelShape;

Expand All @@ -38,8 +41,17 @@ public class CelestialTorch extends Block implements SimpleWaterloggedBlock {
private static final VoxelShape TORCH_SOUTH = Block.box(5.5D, 3.0D, 0.0D, 10.5D, 13.0D, 5.0D);
private static final VoxelShape TORCH_WEST = Block.box(11.0D, 3.0D, 5.5D, 16.0D, 13.0D, 10.5D);

public CelestialTorch(BlockBehaviour.Properties p_57491_) {
super(p_57491_);
public CelestialTorch() {
this(Properties.of()
.pushReaction(PushReaction.DESTROY)
.noCollission()
.sound(SoundType.WOOD)
.lightLevel(state -> 15)
.instabreak());
}

public CelestialTorch(BlockBehaviour.Properties properties) {
super(properties);
this.registerDefaultState(this.getStateDefinition().any().setValue(WATERLOGGED, false));
}

Expand Down
Loading

0 comments on commit 683869b

Please sign in to comment.