Skip to content

Commit

Permalink
release 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HollowHorizon committed Feb 5, 2023
1 parent 663c6d3 commit 4092a1b
Show file tree
Hide file tree
Showing 101 changed files with 1,667 additions and 925 deletions.
5 changes: 4 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@ buildscript {
repositories {
maven { url = 'https://maven.minecraftforge.net' }
maven { url = 'https://repo.spongepowered.org/repository/maven-public/' }
maven { url = 'https://maven.parchmentmc.org' }
mavenCentral()
}
dependencies {
classpath group: 'net.minecraftforge.gradle', name: 'ForgeGradle', version: '5.1.+', changing: true
classpath 'org.parchmentmc:librarian:1.+'
classpath 'org.spongepowered:mixingradle:0.7-SNAPSHOT'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.7.20-RC'
}
Expand All @@ -18,6 +20,7 @@ plugins {
apply plugin: 'kotlin'
apply plugin: "java"
apply plugin: 'net.minecraftforge.gradle'
apply plugin: 'org.parchmentmc.librarian.forgegradle'
apply plugin: 'org.spongepowered.mixin'

group = 'ru.hollowhorizon'
Expand All @@ -29,7 +32,7 @@ java {
}

minecraft {
mappings channel: 'official', version: '1.16.5'
mappings channel: 'parchment', version: '2022.03.06-1.16.5'

accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')

Expand Down
17 changes: 12 additions & 5 deletions src/main/java/ru/hollowhorizon/hollowstory/HollowStory.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ru.hollowhorizon.hollowstory;

import net.minecraft.entity.merchant.villager.VillagerEntity;
import net.minecraft.entity.monster.ZombieEntity;
import net.minecraft.resources.IReloadableResourceManager;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.AddReloadListenerEvent;
import net.minecraftforge.event.RegisterCommandsEvent;
Expand All @@ -14,14 +16,15 @@
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import ru.hollowhorizon.hc.HollowCore;
import ru.hollowhorizon.hc.api.registy.HollowMod;
import ru.hollowhorizon.hollowstory.client.ClientEvents;
import ru.hollowhorizon.hollowstory.client.render.enitites.NPCRenderer;
import ru.hollowhorizon.hollowstory.client.render.enitites.ThomasRenderer;
import ru.hollowhorizon.hollowstory.client.sound.HSSounds;
import ru.hollowhorizon.hollowstory.common.actions.PointTypes;
import ru.hollowhorizon.hollowstory.common.commands.HSCommands;
import ru.hollowhorizon.hollowstory.common.data.DialogueReloadListener;
import ru.hollowhorizon.hollowstory.common.data.HollowStoryPack;
import ru.hollowhorizon.hollowstory.common.entities.ModEntities;
import ru.hollowhorizon.hollowstory.common.hollowscript.story.StoryHandler;
import ru.hollowhorizon.hollowstory.common.events.StoryHandler;
import ru.hollowhorizon.hollowstory.common.files.HollowStoryDirHelper;
import ru.hollowhorizon.hollowstory.common.npcs.NPCSettings;
import ru.hollowhorizon.hollowstory.common.npcs.NPCStorage;

Expand All @@ -43,8 +46,8 @@ public HollowStory() {

forgeBus.addListener(this::registerCommands);
forgeBus.addListener(this::addReloadListenerEvent);
forgeBus.addListener(ClientEvents::renderLast);
forgeBus.addListener(StoryHandler::onPlayerJoin);
forgeBus.addListener(StoryHandler::onServerStart);
forgeBus.addListener(StoryHandler::onPlayerClone);

modBus.addListener(this::setup);
Expand All @@ -57,14 +60,17 @@ public HollowStory() {
}

public void addReloadListenerEvent(AddReloadListenerEvent event) {
event.addListener(new DialogueReloadListener());
//event.addListener(new DialogueReloadListener());
}

private void clientInit(FMLClientSetupEvent event) {
RenderingRegistry.registerEntityRenderingHandler(ModEntities.NPC_ENTITY.get(), NPCRenderer::new);

RenderingRegistry.registerEntityRenderingHandler(ModEntities.THOMAS.get(), (manager) -> new ThomasRenderer(manager, (IReloadableResourceManager) event.getMinecraftSupplier().get().getResourceManager()));
}

private void setup(FMLCommonSetupEvent event) {
HollowStoryDirHelper.init();
NPCStorage.addNPC("Монстр", new NPCSettings());
}

Expand All @@ -74,6 +80,7 @@ private void onLoadingComplete(FMLLoadCompleteEvent event) {

private void onAttributeCreation(EntityAttributeCreationEvent event) {
event.put(ModEntities.NPC_ENTITY.get(), ZombieEntity.createAttributes().build());
event.put(ModEntities.THOMAS.get(), VillagerEntity.createAttributes().build());
}

private void registerCommands(RegisterCommandsEvent event) {
Expand Down
19 changes: 19 additions & 0 deletions src/main/java/ru/hollowhorizon/hollowstory/client/ClientEvents.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package ru.hollowhorizon.hollowstory.client

import net.minecraft.util.math.vector.Matrix4f
import net.minecraftforge.api.distmarker.Dist
import net.minecraftforge.client.event.RenderWorldLastEvent
import net.minecraftforge.eventbus.api.SubscribeEvent
import net.minecraftforge.fml.common.Mod
import ru.hollowhorizon.hollowstory.HollowStory

object ClientEvents {
val PROJ_MAT = Matrix4f().apply { setIdentity() }
val VIEW_MAT = Matrix4f().apply { setIdentity() }

@JvmStatic
fun renderLast(event: RenderWorldLastEvent) {
PROJ_MAT.set(event.projectionMatrix)
VIEW_MAT.set(event.matrixStack.last().pose())
}
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 4092a1b

Please sign in to comment.