Skip to content

Commit

Permalink
initial update to 1.20.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ProjectET committed Jul 31, 2024
1 parent 3568c4b commit 4f2d823
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 34 deletions.
6 changes: 3 additions & 3 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.13-SNAPSHOT'
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'maven-publish'
}

Expand Down Expand Up @@ -78,7 +78,7 @@ dependencies {
exclude group: "net.fabricmc.fabric-api"
}

modLocalRuntime "dev.architectury:architectury-fabric:8.2.91"
modLocalRuntime "dev.architectury:architectury-fabric:12.1.3"
modLocalRuntime modCompileOnly("me.shedaniel:RoughlyEnoughItems-fabric:${project.rei_version}") {
exclude group: "net.fabricmc.fabric-api"
}
Expand All @@ -96,7 +96,7 @@ processResources {
}
}

def targetJavaVersion = 17
def targetJavaVersion = 21
tasks.withType(JavaCompile).configureEach {
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
Expand Down
16 changes: 8 additions & 8 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
# check these on https://modmuss50.me/fabric.html
minecraft_version=1.19.4
minecraft_version=1.20.1
loader_version=0.15.11
# Mod Properties
mod_version=1.2.0
mod_version=1.3.0
maven_group=io.github.projectet
archives_base_name=AE2Things
# Dependencies
# check this on https://modmuss50.me/fabric.html
fabric_version=0.87.2+1.19.4
ae2_version=14.0.0-alpha
cloth_config_version=10.1.117
arch_version=8.2.91
rei_version=11.1.739
wthit_version=5.28.3
fabric_version=0.92.2+1.20.1
ae2_version=15.2.11
cloth_config_version=11.1.118
arch_version=12.1.3
rei_version=12.1.740
wthit_version=8.13.3
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
16 changes: 7 additions & 9 deletions src/main/java/io/github/projectet/ae2things/AE2Things.java
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
package io.github.projectet.ae2things;

import appeng.api.IAEAddonEntrypoint;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Setting;
import appeng.api.config.Settings;
import appeng.api.storage.StorageCells;
import appeng.api.upgrades.Upgrades;
import appeng.block.AEBaseBlockItem;
import appeng.block.AEBaseEntityBlock;
import appeng.core.AppEng;
import appeng.core.definitions.AEItems;
import appeng.menu.AEBaseMenu;
import appeng.menu.SlotSemantic;
import appeng.menu.SlotSemantics;
import io.github.projectet.ae2things.block.BlockAdvancedInscriber;
Expand All @@ -32,29 +27,30 @@
import net.fabricmc.fabric.api.object.builder.v1.block.entity.FabricBlockEntityTypeBuilder;
import net.minecraft.core.Registry;
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntityType;
import net.minecraft.world.level.material.Material;

public class AE2Things implements IAEAddonEntrypoint {

public static final String MOD_ID = "ae2things";

public static final CreativeModeTab ITEM_GROUP = FabricItemGroup.builder(id("item_group")).icon(() -> new ItemStack(AETItems.DISK_HOUSING)).build();
public static final CreativeModeTab ITEM_GROUP = FabricItemGroup.builder().title(Component.translatable("itemGroup.ae2things.item_group")).icon(() -> new ItemStack(AETItems.DISK_HOUSING)).build();

public static StorageManager STORAGE_INSTANCE = new StorageManager();

public static SlotSemantic CG_SEMANTIC = SlotSemantics.register("AE2THINGS_CRYSTAL_GROWTH", false);

public static final Block ADVANCED_INSCRIBER = new BlockAdvancedInscriber(FabricBlockSettings.of(Material.METAL).destroyTime(4f));
public static final Block ADVANCED_INSCRIBER = new BlockAdvancedInscriber(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).destroyTime(4f));
public static BlockEntityType<BEAdvancedInscriber> ADVANCED_INSCRIBER_BE = Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, id("advanced_inscriber_be"), FabricBlockEntityTypeBuilder.create(BEAdvancedInscriber::new, ADVANCED_INSCRIBER).build());


public static final Block CRYSTAL_GROWTH = new BlockCrystalGrowth(FabricBlockSettings.of(Material.METAL).destroyTime(4f));
public static final Block CRYSTAL_GROWTH = new BlockCrystalGrowth(FabricBlockSettings.copyOf(Blocks.IRON_BLOCK).destroyTime(4f));
public static BlockEntityType<BECrystalGrowth> CRYSTAL_GROWTH_BE = Registry.register(BuiltInRegistries.BLOCK_ENTITY_TYPE, id("crystal_growth_be"), FabricBlockEntityTypeBuilder.create(BECrystalGrowth::new, CRYSTAL_GROWTH).build());

public static ResourceLocation id(String path) {
Expand All @@ -68,6 +64,8 @@ private void registerBlockwithItem(String path, Block block) {

@Override
public void onAe2Initialized() {
Registry.register(BuiltInRegistries.CREATIVE_MODE_TAB, id("item_group"), ITEM_GROUP);

Command.init();

StorageCells.addCellHandler(DISKCellHandler.INSTANCE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ public void loadTag(CompoundTag data) {
}

@Override
public void addAdditionalDrops(Level level, BlockPos pos, List<ItemStack> drops, boolean remove) {
super.addAdditionalDrops(level, pos, drops, remove);
public void addAdditionalDrops(Level level, BlockPos pos, List<ItemStack> drops) {
super.addAdditionalDrops(level, pos, drops);

for (var upgrade : upgrades) {
drops.add(upgrade);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,8 +261,8 @@ public void loadTag(CompoundTag data) {
}

@Override
public void addAdditionalDrops(Level level, BlockPos pos, List<ItemStack> drops, boolean remove) {
super.addAdditionalDrops(level, pos, drops, remove);
public void addAdditionalDrops(Level level, BlockPos pos, List<ItemStack> drops) {
super.addAdditionalDrops(level, pos, drops);

for (var upgrade : upgrades) {
drops.add(upgrade);
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/io/github/projectet/ae2things/command/Command.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public static void init() {
.build();

private static int help(CommandContext<CommandSourceStack> context) {
context.getSource().sendSuccess(Component.literal("Available Argument(s): "), false);
context.getSource().sendSuccess(Component.literal("/ae2things recover <UUID> - Spawns a drive with the given UUID, if it doesn't exist, does not spawn any item."), false);
context.getSource().sendSuccess(Component.literal("/ae2things getuuid - Gets the UUID of the drive in the player's hand if it has a UUID. Returns the DISKS uuid."), false);
context.getSource().sendSuccess(() -> Component.literal("Available Argument(s): "), false);
context.getSource().sendSuccess(() -> Component.literal("/ae2things recover <UUID> - Spawns a drive with the given UUID, if it doesn't exist, does not spawn any item."), false);
context.getSource().sendSuccess(() -> Component.literal("/ae2things getuuid - Gets the UUID of the drive in the player's hand if it has a UUID. Returns the DISKS uuid."), false);
return 0;
}

Expand All @@ -68,7 +68,7 @@ private static int spawnDrive(CommandContext<CommandSourceStack> context, UUID u

player.addItem(stack);

context.getSource().sendSuccess(Component.translatable("command.ae2things.recover_success", player.getDisplayName(), uuid), true);
context.getSource().sendSuccess(() -> Component.translatable("command.ae2things.recover_success", player.getDisplayName(), uuid), true);
return 0;
}
else {
Expand All @@ -83,7 +83,7 @@ private static int getUUID(CommandContext<CommandSourceStack> context) throws Co
if(mainStack.getItem() instanceof IDISKCellItem) {
if(mainStack.hasTag() && mainStack.getTag().contains(Constants.DISKUUID)) {
Component text = copyToClipboard(mainStack.getTag().getUUID(Constants.DISKUUID).toString());
context.getSource().sendSuccess(Component.translatable("command.ae2things.getuuid_success", text), false);
context.getSource().sendSuccess(() -> Component.translatable("command.ae2things.getuuid_success", text), false);
return 0;
}
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public class AdvancedInscriberMenu extends UpgradeableMenu<BEAdvancedInscriber>

public AdvancedInscriberMenu(int syncId, Inventory playerInventory, BEAdvancedInscriber advancedInscriber) {
super(ADVANCED_INSCRIBER_SHT, syncId, playerInventory, advancedInscriber);
world = playerInventory.player.level;
world = playerInventory.player.level();
inventory = advancedInscriber.getInternalInventory();

RestrictedInputSlot top = new RestrictedInputSlot(RestrictedInputSlot.PlacableItemType.INSCRIBER_PLATE, inventory, 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public int getMaxProgress() {

public CrystalGrowthMenu(int id, Inventory ip, BECrystalGrowth crystalGrowth) {
super(CRYSTAL_GROWTH_SHT, id, ip, crystalGrowth);
world = ip.player.level;
world = ip.player.level();
inventory = crystalGrowth.getInternalInventory();
int i = 0;
for(int y = 0; y < 3; y++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static void init() {
for(Tuple<ResourceLocation, ? extends Item> pair : ITEMS) {
Registry.register(BuiltInRegistries.ITEM, pair.getA(), pair.getB());
}
ItemGroupEvents.modifyEntriesEvent(ITEM_GROUP).register(group -> {
ItemGroupEvents.modifyEntriesEvent(BuiltInRegistries.CREATIVE_MODE_TAB.getResourceKey(ITEM_GROUP).get()).register(group -> {
for(Tuple<ResourceLocation, ? extends Item> pair : ITEMS) {
group.accept(pair.getB());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public abstract class CursedInternalSlotMixin {
@Shadow
public NonNullList<Slot> slots;

@Inject(method = "doClick", at = @At(value = "INVOKE", target = "net/minecraft/world/item/ItemStack.copy ()Lnet/minecraft/world/item/ItemStack;"), slice = @Slice(from = @At(value = "INVOKE", target = "net/minecraft/world/inventory/Slot.hasItem ()Z")), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
@Inject(method = "doClick", at = @At(value = "INVOKE", target = "net/minecraft/world/item/ItemStack.copyWithCount (I)Lnet/minecraft/world/item/ItemStack;"), slice = @Slice(from = @At(value = "INVOKE", target = "net/minecraft/world/inventory/Slot.hasItem ()Z")), locals = LocalCapture.CAPTURE_FAILHARD, cancellable = true)
public void CLONE(int slotIndex, int button, ClickType actionType, Player player, CallbackInfo ci) {
Slot i = this.slots.get(slotIndex);
if(DISKCellInventory.hasDiskUUID(i.getItem())) {
Expand Down

0 comments on commit 4f2d823

Please sign in to comment.