Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
zoi1op committed Nov 4, 2023
2 parents 8f6f521 + 826b1cd commit ccc631c
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 47 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: AutoBuild

name: AutoBuild
on:
workflow_dispatch:
push:
Expand Down Expand Up @@ -52,14 +52,14 @@ jobs:
arguments: build

- name: Send building message to discord
if: github.event_name == 'push' && github.repository_id == '497754645'
if: github.event_name == 'push' && github.repository_id == '696161740'
uses: realRobotix/action-discord-notifier@release-master
with:
webhook: ${{ secrets.DISCORD_WEBHOOK }}
message-title: Building mod from branch ${{ steps.get_branch.outputs.branch }}

- name: Send built file to discord
if: github.event_name == 'push' && github.repository_id == '497754645'
if: github.event_name == 'push' && github.repository_id == '696161740'
uses: sinshutu/upload-to-discord@master
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
Expand All @@ -69,5 +69,5 @@ jobs:
- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: technomancy-${{ steps.get_mc_version.outputs.mc_version }}-nightly-${{ steps.get_hash.outputs.sha_short }}
name: technomancy-${{ steps.get_mc_version.outputs.mc_version }}-alpha-${{ steps.get_hash.outputs.sha_short }}
path: build/libs/
11 changes: 4 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,14 @@ sourceSets.main.resources { srcDir 'src/generated/resources' }

repositories {
maven {
name "Cursemaven"
name "Cursemaven" // Cursemaven
url "https://cursemaven.com"
content {
includeGroup "curse.maven"
}
}


maven { // mixins
url = 'https://repo.spongepowered.org/repository/maven-public/'
}
Expand All @@ -122,19 +124,14 @@ repositories {
}
}

maven {
maven { // create and maven registrate
url = "https://maven.tterrag.com/"
content {
includeGroup("com.simibubi.create")
includeGroup("com.jozufozu.flywheel")
includeGroup("com.tterrag.registrate")
}
}

maven { // Registrate
name = "tterrag maven"
url = "https://maven.tterrag.com/"
}
}

configurations {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ org.gradle.parallel=true
org.gradle.caching=true

# mod info
mod_version=0.0.1
mod_version=0.0.2
mc_version=1.19.2
archives_base_name=technomancy
maven_group=com.chazbomb.technomancy
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/chazbomb/technomancy/Technomancy.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.forge.event.lifecycle.GatherDataEvent;
import net.minecraftforge.data.event.GatherDataEvent;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

Expand Down
6 changes: 3 additions & 3 deletions src/main/java/com/chazbomb/technomancy/TechnomancyClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import com.chazbomb.technomancy.content.curiosities.weapons.firearms.base.FirearmInteractionHandler;
import com.chazbomb.technomancy.content.curiosities.weapons.firearms.base.FirearmRenderHandler;
import com.chazbomb.technomancy.foundation.keys.TMKeys;
import net.minecraftforge.client.gui.ForgeIngameGui;
import net.minecraftforge.client.gui.OverlayRegistry;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import net.minecraftforge.client.gui.overlay.GuiOverlayManager;
import net.minecraftforge.eventbus.api.IEventBus;

public class TechnomancyClient {
Expand All @@ -21,7 +21,7 @@ public static void onClient(IEventBus modEventBus, IEventBus forgeEventBus) {
private static void registerOverlays() {
// Register overlays in reverse order

OverlayRegistry.registerOverlayAbove(ForgeIngameGui.EXPERIENCE_BAR_ELEMENT, "Test Energy Archer UI", EnergyArcherUI.OVERLAY);
OverlayRegistry.registerOverlayAbove(ForgeGui.EXPERIENCE_BAR_ELEMENT, "Test Energy Archer UI", EnergyArcherUI.OVERLAY);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.BlockEntityType;

public class SoulLiquidatorBlock extends Block implements IBE<SoulLiquidatorBlockEntity> {
public abstract class SoulLiquidatorBlock extends Block implements IBE<SoulLiquidatorBlockEntity> { // I have no doubt about the work

public SoulLiquidatorBlock(Properties props) {
super(props);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
import net.minecraft.core.Direction;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
import net.minecraftforge.client.model.data.ModelData ;
import net.minecraftforge.client.model.data.ModelProperty;
import org.jetbrains.annotations.NotNull;

Expand All @@ -30,8 +29,9 @@ public CableAttachmentModel(BakedModel template) {
}

@Override
protected void gatherModelData(ModelDataMap.Builder builder, BlockAndTintGetter world, BlockPos pos, BlockState state, IModelData blockEntityData) {
protected ModelData.Builder gatherModelData(ModelData.Builder builder, BlockAndTintGetter world, BlockPos pos, BlockState state, ModelData blockEntityData) {
//nothing :)
return builder;
}

/**
Expand Down Expand Up @@ -61,8 +61,8 @@ protected ModelDataMap.Builder gatherModelData(ModelDataMap.Builder builder, Blo
}
*/

@Override
public @NotNull List<BakedQuad> getQuads(BlockState state, Direction side, @NotNull Random rand, @NotNull IModelData data) {

public @NotNull List<BakedQuad> getQuads(BlockState state, Direction side, @NotNull Random rand, @NotNull ModelData data) {
List<BakedQuad> quads = super.getQuads(state, side, rand, data);
if (data.hasProperty(CABLE_PROPERTY)) {
CableAttachmentModel.CableModelData cableData = data.getData(CABLE_PROPERTY);
Expand All @@ -72,7 +72,7 @@ protected ModelDataMap.Builder gatherModelData(ModelDataMap.Builder builder, Blo
return quads;
}

private void addQuads(List<BakedQuad> quads, BlockState state, Direction side, Random rand, IModelData data, CableAttachmentModel.CableModelData cableData) {
private void addQuads(List<BakedQuad> quads, BlockState state, Direction side, Random rand, ModelData data, CableAttachmentModel.CableModelData cableData) {
BakedModel bracket = cableData.getBracket();
if (bracket != null)
quads.addAll(bracket.getQuads(state, side, rand, data));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import net.minecraft.util.Mth;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.GameType;
import net.minecraftforge.client.gui.ForgeIngameGui;
import net.minecraftforge.client.gui.IIngameOverlay;
import net.minecraftforge.client.gui.overlay.ForgeGui;
import net.minecraftforge.client.gui.overlay.IGuiOverlay ;

public class EnergyArcherUI {
public static final IIngameOverlay OVERLAY = EnergyArcherUI::renderOverlay;
public static final IGuiOverlay OVERLAY = EnergyArcherUI::renderOverlay;


public static LerpedFloat displayedSpeed = LerpedFloat.linear();
Expand Down Expand Up @@ -50,7 +50,7 @@ public static void tick() {



public static void renderOverlay(ForgeIngameGui gui, PoseStack poseStack, float partialTicks, int width,
public static void renderOverlay(ForgeGui gui, PoseStack poseStack, float partialTicks, int width,
int height) {

if(!toRender)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.IItemRenderProperties;
import net.minecraftforge.client.extensions.common.IClientItemExtensions ;
import net.minecraftforge.fml.common.Mod;

import java.util.function.Consumer;
Expand Down Expand Up @@ -196,7 +196,7 @@ public UseAnim getUseAnimation(ItemStack pStack) {

@Override
@OnlyIn(Dist.CLIENT)
public void initializeClient(Consumer<IItemRenderProperties> consumer) {
public void initializeClient(Consumer<IClientItemExtensions> consumer) {
consumer.accept(SimpleCustomRenderer.create(this, this.getRenderer()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void onMouseHold(InputEvent.MouseInputEvent event) {


@SubscribeEvent(priority = EventPriority.LOWEST)
public void onMouseClick(InputEvent.ClickInputEvent event) {
public void onMouseClick(InputEvent.MouseButton event) {
if (event.isCanceled())
return;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraftforge.common.capabilities.RegisterCapabilitiesEvent;
import net.minecraftforge.event.AttachCapabilitiesEvent;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;

Expand All @@ -24,10 +23,7 @@ public static void attachChunkCapabilities(AttachCapabilitiesEvent<LevelChunk> e
// QuantumHandler.attach(event);
}

@SubscribeEvent
public static void onWorldTick(TickEvent.WorldTickEvent event){

}

@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD)
public static class ModBusEvents {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@Mod.EventBusSubscriber(Dist.CLIENT)
public class TMInputEvents {
@SubscribeEvent
public static void onMouseScrolled(InputEvent.MouseScrollEvent event) {
public static void onMouseScrolled(InputEvent.MouseScrollingEvent event) {
if (Minecraft.getInstance().screen != null)
return;

Expand Down
5 changes: 3 additions & 2 deletions src/main/java/com/chazbomb/technomancy/foundation/TMLang.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import com.chazbomb.technomancy.Technomancy;
import com.simibubi.create.foundation.utility.Lang;
import com.simibubi.create.foundation.utility.LangBuilder;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.ComponentContents;

public class TMLang {
public static LangBuilder lang() { return Lang.builder(Technomancy.MOD_ID); }
public static LangBuilder translate(String key, Object... args) { return lang().translate(key, args); }

public static TextComponent translateText(String key) { return new TextComponent(Technomancy.MOD_ID + key); }
public static Component.Serializer translateText(String key) { return new Component.Serializer(Technomancy.MOD_ID + key); }
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
import net.minecraft.client.KeyMapping;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.client.ClientRegistry;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;

@OnlyIn(Dist.CLIENT)
public class TMKeys {
public static final KeyMapping reload = new KeyMapping("key.technomancy.reload", InputConstants.KEY_R, "key.category.createwarfare");

public static void register() {
Technomancy.LOGGER.info("Registering keys!");
ClientRegistry.registerKeyBinding(reload);
RegisterKeyMappingsEvent.registerKeyBinding(reload);
}
}
10 changes: 5 additions & 5 deletions src/main/java/com/chazbomb/technomancy/registry/TMFluids.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,21 @@
import com.simibubi.create.AllTags;

import com.simibubi.create.foundation.data.CreateRegistrate;
import com.tterrag.registrate.builders.Builder;
import com.tterrag.registrate.builders.FluidBuilder;
import com.tterrag.registrate.util.entry.FluidEntry;
import com.tterrag.registrate.util.nullness.NonNullBiFunction;
import net.minecraft.core.BlockPos;
import net.minecraft.tags.FluidTags;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.material.Fluid;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidType;
import net.minecraftforge.fluids.ForgeFlowingFluid;

import static com.chazbomb.technomancy.Technomancy.REGISTRATE;

public class TMFluids {
private static FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> fluid(String name, NonNullBiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory,
private static FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> fluid(String name, NonNullBiFunction<FluidType, Fluid, FluidType> attributesFactory,
int viscosity, int density, int levelDecreasePerBlock, int tickRate, int slopeFindDistance,
float explosionResistance) {
String realName = name.replace('_', ' ').transform(s -> {
Expand All @@ -39,7 +40,7 @@ private static FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> fluid(S
.slopeFindDistance(slopeFindDistance)
.explosionResistance(explosionResistance));
}
private static FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> fluid(String name, NonNullBiFunction<FluidAttributes.Builder, Fluid, FluidAttributes> attributesFactory) {
private static FluidBuilder<ForgeFlowingFluid.Flowing, CreateRegistrate> fluid(String name, NonNullBiFunction<FluidType, Fluid, FluidType> attributesFactory) {
return fluid(name, attributesFactory, 2000, 1400, 2, 25, 3, 100f);
}

Expand All @@ -57,13 +58,12 @@ public static void register() {
}


private static class NoColorFluidAttributes extends FluidAttributes {
private static class NoColorFluidAttributes extends FluidType {

protected NoColorFluidAttributes(Builder builder, Fluid fluid) {
super(builder, fluid);
}

@Override
public int getColor(BlockAndTintGetter world, BlockPos pos) {
return 0x00ffffff;
}
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/chazbomb/technomancy/registry/TMTags.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.IForgeRegistry;
import net.minecraftforge.registries.IForgeRegistryEntry;

import java.util.Collections;
import java.util.Objects;
Expand All @@ -31,13 +30,13 @@ public class TMTags {
private static final CreateRegistrate REGISTRATE = Technomancy.REGISTRATE
.creativeModeTab(() -> TMItemGroups.MAIN_GROUP);

public static <T extends IForgeRegistryEntry<T>> TagKey<T> optionalTag(IForgeRegistry<T> registry,
public static <T extends IForgeRegistry<T>> TagKey<T> optionalTag(IForgeRegistry<T> registry,
ResourceLocation id) {
return Objects.requireNonNull(registry.tags())
.createOptionalTagKey(id, Collections.emptySet());
}

public static <T extends IForgeRegistryEntry<T>> TagKey<T> forgeTag(IForgeRegistry<T> registry, String path) {
public static <T extends IForgeRegistry<T>> TagKey<T> forgeTag(IForgeRegistry<T> registry, String path) {
return optionalTag(registry, new ResourceLocation("forge", path));
}

Expand Down

0 comments on commit ccc631c

Please sign in to comment.