Skip to content

Commit

Permalink
Merge branch 'migrate-1.18.2' into 1.18-forge
Browse files Browse the repository at this point in the history
  • Loading branch information
WakelessSloth56 committed Mar 7, 2022
2 parents 8a60e01 + bbb2b2d commit 1958b07
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 12 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ Shared library for AH's Minecraft mods.
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/auioc/arnicalib-mcmod/auto-release?label=release%20build&style=flat-square)](https://github.com/auioc/arnicalib-mcmod/actions/workflows/auto-release.yml)
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/auioc/arnicalib-mcmod/dev-build?label=dev%20build&style=flat-square)](https://github.com/auioc/arnicalib-mcmod/actions/workflows/dev-build.yml)
<br/>
![Minecraft](https://img.shields.io/static/v1?label=Minecraft&message=1.18.1&color=00aa00&style=flat-square)
[![Forge](https://img.shields.io/static/v1?label=Forge&message=39.0.75&color=e04e14&logo=Conda-Forge&style=flat-square)](http://files.minecraftforge.net/net/minecraftforge/forge/index_1.18.1.html)
![Minecraft](https://img.shields.io/static/v1?label=Minecraft&message=1.18.2&color=00aa00&style=flat-square)
[![Forge](https://img.shields.io/static/v1?label=Forge&message=40.0.3&color=e04e14&logo=Conda-Forge&style=flat-square)](http://files.minecraftforge.net/net/minecraftforge/forge/index_1.18.2.html)
[![AdoptiumOpenJDK](https://img.shields.io/static/v1?label=AdoptiumOpenJDK&message=17.0.2%2B8&color=brightgreen&logo=java&style=flat-square)](https://adoptium.net/?variant=openjdk17&jvmVariant=hotspot)
[![Gradle](https://img.shields.io/static/v1?label=Gradle&message=7.3&color=brightgreen&logo=gradle&style=flat-square)](https://docs.gradle.org/7.3/release-notes.html)

</div>

<!--
## For Developers
There are two ways to use this mod in your workspace:
Expand Down Expand Up @@ -59,6 +60,7 @@ If you do not want to or can not use the GitHub Packages:
implementation files("libs/arnicalib-<VERSION>-forgelib.jar")
}
```
-->

## Maintainers

Expand Down
2 changes: 2 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ minecraft {
}
}

sourceSets.remove(sourceSets.test)

dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"

Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
org.gradle.jvmargs=-Xmx4G -Dhttps://maven.minecraftforge.net/=false
org.gradle.daemon=false

minecraft_version=1.18.1
forge_version=39.0.75
minecraft_version=1.18.2
forge_version=40.0.12

mappings_channel=official
mappings_version=1.18.1
mappings_version=1.18.2

mixin_version=0.8.5

Expand Down
12 changes: 10 additions & 2 deletions src/main/java/org/auioc/mods/arnicalib/Initialization.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.auioc.mods.arnicalib.server.loot.AHLootItemFunctions;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.common.loot.GlobalLootModifierSerializer;
import net.minecraftforge.event.RegistryEvent;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
Expand Down Expand Up @@ -48,12 +50,18 @@ public CommonSetup(final IEventBus modEventBus, final IEventBus forgeEventBus) {

public void registerConfig() {}

@SuppressWarnings(value = {"unchecked", "rawtypes"})
private void modSetup() {
AHPacketHandler.init();
AHCommandArguments.init();
AHLootItemConditions.init();
AHLootItemFunctions.init();
modEventBus.register(AHGlobalLootModifiers.class);
modEventBus.addGenericListener(
GlobalLootModifierSerializer.class, // It works within any RegistryEvent.Register
(RegistryEvent.Register event) -> {
AHLootItemConditions.init();
AHLootItemFunctions.init();
}
);
}

private void forgeSetup() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.Style;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.tags.TagKey;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
Expand Down Expand Up @@ -39,10 +40,11 @@ public static void handle(ItemTooltipEvent event) {
addLine(event, nbtTooltip);
}

if ((itemStack.getItem().getTags()).size() > 0) {
var tags = itemStack.getTags().toList();
if (tags.size() > 0) {
addLine(event, new TextComponent("Tags:").setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GRAY)));
for (ResourceLocation tag : itemStack.getItem().getTags()) {
addLine(event, new TextComponent(" " + tag).setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GRAY)));
for (TagKey<Item> tag : tags) {
addLine(event, new TextComponent(" " + tag.location()).setStyle(Style.EMPTY.withColor(ChatFormatting.DARK_GRAY)));
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.InteractionResultHolder;
Expand All @@ -34,7 +35,11 @@ public abstract class MixinEnderEyeItem {
require = 1,
allow = 1
)
private void use(Level p_41184_, Player p_41185_, InteractionHand p_41186_, CallbackInfoReturnable<InteractionResultHolder> cir, ItemStack itemstack, HitResult hitresult, BlockPos blockpos, EyeOfEnder eyeofender) {
private void use(
Level p_41184_, Player p_41185_, InteractionHand p_41186_,
CallbackInfoReturnable<InteractionResultHolder> cir,
ItemStack itemstack, HitResult hitresult, ServerLevel serverlevel, BlockPos blockpos, EyeOfEnder eyeofender
) {
((IMixinEyeOfEnder) eyeofender).setSurvivable(ServerEventFactory.fireSetEyeOfEnderSurvivableEvent((ServerPlayer) p_41185_, eyeofender));
}

Expand Down

0 comments on commit 1958b07

Please sign in to comment.