Skip to content

Commit

Permalink
Fix: Server not loading mod constructor
Browse files Browse the repository at this point in the history
Merge pull request #17 from EngineerSmith/multiplayer
  • Loading branch information
EngineerSmith authored Jan 31, 2024
2 parents 17a47a6 + d331e0d commit 8d226f6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/java/com/kikis/ptdyeplus/PtdyePlus.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
import org.slf4j.Logger;
import java.util.*;

@Mod(PtdyePlus.ID)
public class PtdyePlus
{
public static final String ID = "ptdyeplus";
public static final Logger LOGGER = LogUtils.getLogger();
private static final Minecraft minecraft = Minecraft.getInstance();

public PtdyePlus()
{
MinecraftForge.EVENT_BUS.register(this);
Expand All @@ -59,6 +60,8 @@ public static void registerCommands(RegisterCommandsEvent event){
@Mod.EventBusSubscriber(modid = PtdyePlus.ID, value = Dist.CLIENT)
public static class ClientForgeEvents {

private static final Minecraft minecraft = Minecraft.getInstance();

@SubscribeEvent
public static void onKeyInput(InputEvent.Key event) throws NoSuchElementException {
if(PonderTooltipComponentProvider.KEY_TRY_PONDER.get().consumeClick()) {
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/kikis/ptdyeplus/init/BlockEntityInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class BlockEntityInit {
public static final RegistryObject<BlockEntityType<CrateEntity>> CRATE = register("crate", () -> BlockEntityType.Builder.of(CrateEntity::new, BlockInit.CRATE.get()).build(null));

public static <T extends BlockEntityType>RegistryObject<T> register(String name, Supplier<T> supplier) {
PtdyePlus.LOGGER.info("Registering block as block-entity: {}", name);

RegistryObject<T> entityType = ENTITY_TYPES.register(name, supplier);
return entityType;
}
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/kikis/ptdyeplus/init/BlockInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ public class BlockInit{
);

public static <T extends Block> RegistryObject<T> register(String name, Supplier<T> supplier, Item.Properties properties) {
PtdyePlus.LOGGER.info("Registering block and block-item: {}", name);

RegistryObject<T> block = BLOCKS.register(name, supplier);
ItemInit.ITEMS.register(name, ()-> new BlockItem(block.get(), properties));
return block;
Expand Down

0 comments on commit 8d226f6

Please sign in to comment.