Skip to content

Commit

Permalink
- removed Discord integration (unnecessary)
Browse files Browse the repository at this point in the history
- cleaned code up
- updated to 1.20.4 + updated dependencies
  • Loading branch information
tobi1craft committed Feb 1, 2024
1 parent 6a9e8bb commit 6c32456
Show file tree
Hide file tree
Showing 38 changed files with 372 additions and 374 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ name: Publish on Github, CurseForge & Modrinth
- pull_request
- workflow_dispatch
env:
MINECRAFT_VERSION: 1.20.1
MINECRAFT_VERSION: 1.20.4
JAVA_VERSION: 17
VERSION: 0.3+1.20.1
RELEASE_NAME: Concacity v0.3 for 1.20.1
OWO_VERSION: 0.11.1+1.20
GECKOLIB_VERSION: 4.2.2
VERSION: 0.4.0+1.20.4
RELEASE_NAME: Concacity v0.4.0 for 1.20.4
OWO_VERSION: 0.12.3+1.20.3
GECKOLIB_VERSION: 4.4.2
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.PUBLISH_MODRINTH_TOKEN }}
CURSEFORGE_TOKEN: ${{ secrets.PUBLISH_CURSEFORGE_TOKEN }}
Expand Down Expand Up @@ -46,7 +46,7 @@ jobs:
github-token: ${{env.GITHUB_TOKEN}}
name: ${{env.RELEASE_NAME}}
version: ${{env.VERSION}}
version-type: release
version-type: alpha
changelog-file: CHANGELOG.md
loaders: fabric
game-versions: ${{env.MINECRAFT_VERSION}}
Expand Down
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
-started to add Helping NPCs (Guard)
- started to add Helping NPCs (Guard)
- removed Discord integration (unnecessary)
- cleaned code up
- updated to 1.20.4 + updated dependencies
10 changes: 5 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ buildscript {


plugins {
id 'fabric-loom' version '1.2-SNAPSHOT'
id 'fabric-loom' version '1.5-SNAPSHOT'
id 'maven-publish'
}

Expand All @@ -30,6 +30,10 @@ repositories {
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroupByRegex("software\\.bernie.*")
includeGroup("com.eliotlash.mclib")
}
}
}

Expand All @@ -46,10 +50,6 @@ dependencies {
annotationProcessor modImplementation("io.wispforest:owo-lib:${project.owo_version}")
include "io.wispforest:owo-sentinel:${project.owo_version}"

implementation("net.dv8tion:JDA:5.0.0-beta.12") {
exclude module: 'opus-java'
}

//GeckoLib (Models)
modImplementation "software.bernie.geckolib:geckolib-fabric-${project.minecraft_version}:${project.geckolib_version}"
}
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
org.gradle.jvmargs=-Xmx3G

# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.10
loader_version=0.14.22
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
loader_version=0.15.6

# Mod Properties
mod_version = 0.3
mod_version = 0.4.0
maven_group = de.tobi1craft
archives_base_name = concacity

# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.87.0+1.20.1
fabric_version=0.95.1+1.20.4
# https://maven.wispforest.io/io/wispforest/owo-lib/
owo_version=0.11.1+1.20
owo_version=0.12.3+1.20.3
# Geckolib for models / animations
geckolib_version=4.2.2
geckolib_version=4.4.2

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
22 changes: 13 additions & 9 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -130,26 +131,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +202,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

7 changes: 2 additions & 5 deletions src/main/java/de/tobi1craft/concacity/Concacity.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@

import de.tobi1craft.concacity.block.ModBlocks;
import de.tobi1craft.concacity.client.ModItemGroup;
import de.tobi1craft.concacity.discord.Discord;
import de.tobi1craft.concacity.entity.ModEntities;
import de.tobi1craft.concacity.entity.goal.ModGoals;
import de.tobi1craft.concacity.event.ModEvents;
import de.tobi1craft.concacity.client.gui.ModGUIs;
import de.tobi1craft.concacity.client.gui.miner.HelperMinerInventoryHandler;
import de.tobi1craft.concacity.item.ModItems;
import de.tobi1craft.concacity.util.ConcacityConfig;
import de.tobi1craft.concacity.util.ModChannels;
Expand All @@ -16,7 +15,6 @@
import net.fabricmc.fabric.api.screenhandler.v1.ExtendedScreenHandlerType;
import net.minecraft.registry.Registries;
import net.minecraft.registry.Registry;
import net.minecraft.resource.featuretoggle.FeatureFlags;
import net.minecraft.screen.*;
import net.minecraft.util.Identifier;
import org.slf4j.Logger;
Expand All @@ -26,7 +24,7 @@ public class Concacity implements ModInitializer {
public static final String ID = "concacity";
public static final Logger LOGGER = LoggerFactory.getLogger("concacity");
public static final ConcacityConfig CONFIG = ConcacityConfig.createAndLoad();
public static ScreenHandlerType<ModGUIs> SCREEN_HANDLER_TYPE = new ExtendedScreenHandlerType<>(ModGUIs::new);
public static ScreenHandlerType<HelperMinerInventoryHandler> SCREEN_HANDLER_TYPE = new ExtendedScreenHandlerType<>(HelperMinerInventoryHandler::new);
static {
SCREEN_HANDLER_TYPE = Registry.register(Registries.SCREEN_HANDLER, new Identifier(ID, "screenhandler"), SCREEN_HANDLER_TYPE);
}
Expand All @@ -43,6 +41,5 @@ public void onInitialize() {
ModEvents.registerModEvents();
ModGoals.registerGoals();
ModEntities.registerModEntities();
if(CONFIG.discord_enabled()) Discord.registerDiscord();
}
}
4 changes: 3 additions & 1 deletion src/main/java/de/tobi1craft/concacity/block/ModBlocks.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import de.tobi1craft.concacity.client.ModItemGroup;
import net.fabricmc.fabric.api.item.v1.FabricItemSettings;
import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.minecraft.block.Block;
import net.minecraft.block.MapColor;
import net.minecraft.item.BlockItem;
import net.minecraft.item.Item;
import net.minecraft.registry.Registries;
Expand All @@ -13,7 +15,7 @@

public class ModBlocks {

//public static final Block CONCACITY_BLOCK = registerBlock("concacity_block", new Block(FabricBlockSettings.create().mapColor(MapColor.BRIGHT_RED).strength(1F)));
public static final Block CONCACITY_BLOCK = registerBlock("concacity_block", new Block(FabricBlockSettings.create().mapColor(MapColor.BRIGHT_RED).strength(1F)));

private static Block registerBlock(String name, Block block) {
registerBlockItem(name, block);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import de.tobi1craft.concacity.client.key.ModKeys;
import de.tobi1craft.concacity.client.util.ClientChannels;
import de.tobi1craft.concacity.entity.ModEntities;
import de.tobi1craft.concacity.client.entity.HelperRenderer;
import de.tobi1craft.concacity.client.entity.HelperMinerRenderer;
import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
Expand All @@ -21,6 +21,6 @@ public void onInitializeClient() {
ModGUIs.registerModGUIs();
ModKeys.registerModKeys();

EntityRendererRegistry.register(ModEntities.HELPER, HelperRenderer::new);
EntityRendererRegistry.register(ModEntities.HELPER, HelperMinerRenderer::new);
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.tobi1craft.concacity.client.entity;

import de.tobi1craft.concacity.Concacity;
import de.tobi1craft.concacity.entity.custom.HelperEntity;
import de.tobi1craft.concacity.entity.helper.HelperMinerEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import software.bernie.geckolib.constant.DataTickets;
Expand All @@ -10,24 +10,24 @@
import software.bernie.geckolib.model.GeoModel;
import software.bernie.geckolib.model.data.EntityModelData;

public class HelperModel extends GeoModel<HelperEntity> {
public class HelperMinerModel extends GeoModel<HelperMinerEntity> {
@Override
public Identifier getModelResource(HelperEntity animatable) {
public Identifier getModelResource(HelperMinerEntity animatable) {
return new Identifier(Concacity.ID, "geo/helper.geo.json");
}

@Override
public Identifier getTextureResource(HelperEntity animatable) {
public Identifier getTextureResource(HelperMinerEntity animatable) {
return new Identifier(Concacity.ID, "textures/entity/helper.png");
}

@Override
public Identifier getAnimationResource(HelperEntity animatable) {
public Identifier getAnimationResource(HelperMinerEntity animatable) {
return new Identifier(Concacity.ID, "animations/helper.animation.json");
}

@Override
public void setCustomAnimations(HelperEntity animatable, long instanceId, AnimationState<HelperEntity> animationState) {
public void setCustomAnimations(HelperMinerEntity animatable, long instanceId, AnimationState<HelperMinerEntity> animationState) {
CoreGeoBone head = getAnimationProcessor().getBone("head");
if (head != null) {
EntityModelData entityData = animationState.getData(DataTickets.ENTITY_MODEL_DATA);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
package de.tobi1craft.concacity.client.entity;

import de.tobi1craft.concacity.Concacity;
import de.tobi1craft.concacity.entity.custom.HelperEntity;
import de.tobi1craft.concacity.entity.helper.HelperMinerEntity;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import software.bernie.geckolib.renderer.GeoEntityRenderer;

public class HelperRenderer extends GeoEntityRenderer<HelperEntity> {
public HelperRenderer(EntityRendererFactory.Context renderManager) {
super(renderManager, new HelperModel());
public class HelperMinerRenderer extends GeoEntityRenderer<HelperMinerEntity> {
public HelperMinerRenderer(EntityRendererFactory.Context renderManager) {
super(renderManager, new HelperMinerModel());
}

@Override
public Identifier getTextureLocation(HelperEntity animatable) {
public Identifier getTextureLocation(HelperMinerEntity animatable) {
return new Identifier(Concacity.ID, "textures/entity/helper.png");
}

@Override
public void render(HelperEntity entity, float entityYaw, float partialTick, MatrixStack poseStack, VertexConsumerProvider bufferSource, int packedLight) {
public void render(HelperMinerEntity entity, float entityYaw, float partialTick, MatrixStack poseStack, VertexConsumerProvider bufferSource, int packedLight) {
if (entity.isBaby()) poseStack.scale(0.4f, 0.4f, 0.4f);
super.render(entity, entityYaw, partialTick, poseStack, bufferSource, packedLight);
}
Expand Down
52 changes: 3 additions & 49 deletions src/main/java/de/tobi1craft/concacity/client/gui/ModGUIs.java
Original file line number Diff line number Diff line change
@@ -1,58 +1,12 @@
package de.tobi1craft.concacity.client.gui;

import de.tobi1craft.concacity.Concacity;
import de.tobi1craft.concacity.entity.custom.HelperEntity;
import io.wispforest.owo.client.screens.ScreenUtils;
import io.wispforest.owo.client.screens.SlotGenerator;
import net.minecraft.client.MinecraftClient;
import de.tobi1craft.concacity.client.gui.miner.HelperMinerInventoryGUI;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
import net.minecraft.entity.Entity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.Inventory;
import net.minecraft.inventory.SimpleInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.screen.ScreenHandler;
import net.minecraft.screen.ScreenHandlerContext;

public class ModGUIs extends ScreenHandler {
public final HelperEntity targetedEntity;
public final Inventory inv;
private final Inventory inventory;
public int upgrade_mode;
public int mode;

public ModGUIs(int syncId, PlayerInventory playerInventory, PacketByteBuf buf) {
this(syncId, playerInventory, new SimpleInventory(4), ScreenHandlerContext.EMPTY, MinecraftClient.getInstance().targetedEntity);
upgrade_mode = buf.readInt();
mode = buf.readInt();
}

@SuppressWarnings("unused")
public ModGUIs(int syncId, PlayerInventory playerInventory, Inventory inventory, ScreenHandlerContext context, Entity targetedEntity) {
super(Concacity.SCREEN_HANDLER_TYPE, syncId);
this.inventory = inventory;
this.inv = (Inventory) targetedEntity;
this.targetedEntity = (HelperEntity) targetedEntity;

SlotGenerator.begin(this::addSlot, 8, 84)
.grid(inv, 0, 2, 1)
.playerInventory(playerInventory);
}

public class ModGUIs {
public static void registerModGUIs() {
Concacity.LOGGER.info("registering mod GUIs");
HandledScreens.register(Concacity.SCREEN_HANDLER_TYPE, HelperInventoryGUI::new);
}

@Override
public ItemStack quickMove(PlayerEntity player, int slot) {
return ScreenUtils.handleSlotTransfer(this, slot, 4);
}

@Override
public boolean canUse(PlayerEntity player) {
return true;
HandledScreens.register(Concacity.SCREEN_HANDLER_TYPE, HelperMinerInventoryGUI::new);
}
}
Loading

0 comments on commit 6c32456

Please sign in to comment.