diff --git a/.gitignore b/.gitignore index 3c37caf..3af7274 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ +build/ + # User-specific stuff .idea/ @@ -23,7 +25,6 @@ atlassian-ide-plugin.xml *.ctxt # Package Files # -*.jar *.war *.nar *.ear diff --git a/build.gradle b/build.gradle index 8e2522d..a119a91 100644 --- a/build.gradle +++ b/build.gradle @@ -8,6 +8,11 @@ version = "${project.mod_version}+${project.minecraft_base_version}" group = project.maven_group repositories { + + flatDir { + dirs 'owo-lib_local_repo' + } + maven { url "https://maven.shedaniel.me/" } maven { url "https://maven.wispforest.io/"} diff --git a/gradle.properties b/gradle.properties index 85e47bd..601ed5c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,7 +7,7 @@ minecraft_version=1.18.2 yarn_mappings=1.18.2+build.2 loader_version=0.13.3 # Mod Properties -mod_version=0.2.18 +mod_version=0.2.19 maven_group=com.glisco archives_base_name=things # Dependencies @@ -22,11 +22,14 @@ patchouli_version=1.18.2-66-FABRIC # https://www.curseforge.com/minecraft/mc-mods/roughly-enough-items/files rei_version=8.0.442 +# https://www.curseforge.com/minecraft/mc-mods/architectury-api/files/all?filter-status=1&filter-game-version=2020709689:9008 +architectury_version=4.9.8.4 + # https://www.curseforge.com/minecraft/mc-mods/modmenu/files modmenu_version=3.1.0 # https://maven.wispforest.io/io/wispforest/owo-lib/ -owo_version=0.6.0+1.18 +owo_version=0.7.3+1.18 # https://github.com/CrimsonDawn45/Fabric-Shield-Lib/releases fabric_shield_lib_version=1.5.3-1.18 diff --git a/src/main/java/com/glisco/things/Things.java b/src/main/java/com/glisco/things/Things.java index 73d52aa..4512f6f 100644 --- a/src/main/java/com/glisco/things/Things.java +++ b/src/main/java/com/glisco/things/Things.java @@ -19,6 +19,7 @@ import io.wispforest.owo.particles.systems.ParticleSystem; import io.wispforest.owo.particles.systems.ParticleSystemController; import io.wispforest.owo.registration.reflect.FieldRegistrationHandler; +import io.wispforest.owo.util.Maldenhagen; import me.shedaniel.autoconfig.AutoConfig; import me.shedaniel.autoconfig.serializer.JanksonConfigSerializer; import net.fabricmc.api.ModInitializer; @@ -108,6 +109,7 @@ public void onInitialize() { if (CONFIG.generateGleamingOre) { BiomeModifications.addFeature(notNetherOrEndSelector(), GenerationStep.Feature.UNDERGROUND_ORES, GLEAMING_ORE.getKey().get()); + Maldenhagen.injectCopium(ThingsBlocks.GLEAMING_ORE); } Registry.register(Registry.RECIPE_TYPE, id("sock_upgrade_crafting"), SockUpgradeRecipe.Type.INSTANCE); @@ -126,7 +128,7 @@ public void onInitialize() { SHIELD_PREDICATE = SHIELD_PREDICATE.or(item -> item instanceof FabricShield); } - BROKEN_WATCH_RECIPE = ImmutableSet.of(Items.LEATHER, Items.CLOCK, ThingsItems.GLEAMING_COMPOUND); + BROKEN_WATCH_RECIPE = ImmutableSet.of(Items.LEATHER, Items.CLOCK, ThingsItems.GLEAMING_COMPOUND); if (Owo.DEBUG) { CommandRegistrationCallback.EVENT.register((dispatcher, dedicated) -> { diff --git a/src/main/java/com/glisco/things/blocks/ThingsBlocks.java b/src/main/java/com/glisco/things/blocks/ThingsBlocks.java index 397e13a..0f2317e 100644 --- a/src/main/java/com/glisco/things/blocks/ThingsBlocks.java +++ b/src/main/java/com/glisco/things/blocks/ThingsBlocks.java @@ -26,6 +26,7 @@ public class ThingsBlocks implements BlockRegistryContainer { public static final Block STONE_GLOWSTONE_FIXTURE = new GlowstoneFixtureBlock(); public static final Block QUARTZ_GLOWSTONE_FIXTURE = new GlowstoneFixtureBlock(); + public static final Block DEEPSLATE_GLOWSTONE_FIXTURE = new GlowstoneFixtureBlock(); public static final Block GLEAMING_ORE = new OreBlock(FabricBlockSettings.copyOf(Blocks.DIAMOND_ORE).luminance(5).requiresTool(), UniformIntProvider.create(3, 7)); public static final Block DEEPSLATE_GLEAMING_ORE = new OreBlock(FabricBlockSettings.copyOf(Blocks.DEEPSLATE_DIAMOND_ORE).luminance(5).requiresTool(), UniformIntProvider.create(3, 7)); diff --git a/src/main/java/com/glisco/things/client/ThingsClient.java b/src/main/java/com/glisco/things/client/ThingsClient.java index deb1bfd..50191cf 100644 --- a/src/main/java/com/glisco/things/client/ThingsClient.java +++ b/src/main/java/com/glisco/things/client/ThingsClient.java @@ -1,12 +1,12 @@ package com.glisco.things.client; import com.glisco.things.Things; +import com.glisco.things.ThingsNetwork; import com.glisco.things.blocks.ThingsBlocks; import com.glisco.things.items.ThingsItems; import com.glisco.things.items.generic.DisplacementTomeItem; import com.glisco.things.items.trinkets.AppleTrinket; import com.glisco.things.items.trinkets.SocksItem; -import com.glisco.things.ThingsNetwork; import dev.emi.trinkets.api.client.TrinketRenderer; import dev.emi.trinkets.api.client.TrinketRendererRegistry; import net.fabricmc.api.ClientModInitializer; diff --git a/src/main/java/com/glisco/things/items/trinkets/ArmExtenderItem.java b/src/main/java/com/glisco/things/items/trinkets/ArmExtenderItem.java index 43286fd..07f0c15 100644 --- a/src/main/java/com/glisco/things/items/trinkets/ArmExtenderItem.java +++ b/src/main/java/com/glisco/things/items/trinkets/ArmExtenderItem.java @@ -2,15 +2,12 @@ import com.glisco.things.Things; import com.glisco.things.items.TrinketItemWithOptionalTooltip; -import com.google.common.collect.ImmutableMultimap; import com.google.common.collect.Multimap; import com.jamieswhiteshirt.reachentityattributes.ReachEntityAttributes; import dev.emi.trinkets.api.SlotReference; -import net.minecraft.entity.EquipmentSlot; import net.minecraft.entity.LivingEntity; import net.minecraft.entity.attribute.EntityAttribute; import net.minecraft.entity.attribute.EntityAttributeModifier; -import net.minecraft.entity.attribute.EntityAttributes; import net.minecraft.item.ItemStack; import java.util.UUID; diff --git a/src/main/java/com/glisco/things/misc/DisplacementTomeScreenHandler.java b/src/main/java/com/glisco/things/misc/DisplacementTomeScreenHandler.java index 7fb3214..b09d9ff 100644 --- a/src/main/java/com/glisco/things/misc/DisplacementTomeScreenHandler.java +++ b/src/main/java/com/glisco/things/misc/DisplacementTomeScreenHandler.java @@ -1,9 +1,10 @@ package com.glisco.things.misc; import com.glisco.things.Things; +import com.glisco.things.ThingsNetwork; import com.glisco.things.items.ThingsItems; import com.glisco.things.items.generic.DisplacementTomeItem; -import com.glisco.things.ThingsNetwork; +import io.wispforest.owo.client.screens.ScreenUtils; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.item.ItemStack; @@ -101,9 +102,14 @@ public boolean onButtonClick(PlayerEntity player, int id) { return true; } - public static final record UpdateClientPacket(ItemStack tome) {} + @Override + public ItemStack transferSlot(PlayerEntity player, int index) { + return ScreenUtils.handleSlotTransfer(this, index, 0); + } + + public record UpdateClientPacket(ItemStack tome) {} - public static final record ActionPacket(Action action, String data) { + public record ActionPacket(Action action, String data) { public enum Action {TELEPORT, DELETE_POINT, RENAME_POINT, CREATE_POINT} public static ActionPacket teleport(String where) { diff --git a/src/main/java/com/glisco/things/mixin/Copenhagen.java b/src/main/java/com/glisco/things/mixin/Copenhagen.java deleted file mode 100644 index 3b6bfc9..0000000 --- a/src/main/java/com/glisco/things/mixin/Copenhagen.java +++ /dev/null @@ -1,60 +0,0 @@ -package com.glisco.things.mixin; - -import com.glisco.things.blocks.ThingsBlocks; -import net.minecraft.block.Block; -import net.minecraft.block.BlockState; -import net.minecraft.util.math.BlockPos; -import net.minecraft.world.ChunkSectionCache; -import net.minecraft.world.StructureWorldAccess; -import net.minecraft.world.chunk.ChunkSection; -import net.minecraft.world.gen.feature.OreFeature; -import net.minecraft.world.gen.feature.OreFeatureConfig; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; -import org.spongepowered.asm.mixin.injection.callback.LocalCapture; - -import java.util.*; - -// welcome to maldenhagen -@Mixin(OreFeature.class) -public class Copenhagen { - - // this map contains the seethe'd orr blocks. its quite important - private final Map THINGS$SEETHING = new HashMap<>(); - - // this target method is just so damn complex that not even mixin can correctly guess the injector signature. - // i just kinda gave up and deleted some of them until it worked. very epic - // - // oh also the method caches all the spots that gleaming ore was placed at, so we can later update them for it to glow. - // of course that needs to be done later, because mojang decided it should. the actual reason is that ChunkSectionCache - // locks its chunk sections. - // - // now you would think this throws an error when you then try to modify those sections. but no. - // it just silently deadlocks the entire game - @SuppressWarnings("InvalidInjectorMethodSignature") - @Inject(method = "generateVeinPart", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/chunk/ChunkSection;setBlockState(IIILnet/minecraft/block/BlockState;Z)Lnet/minecraft/block/BlockState;"), locals = LocalCapture.CAPTURE_FAILHARD) - private void malding(StructureWorldAccess world, Random random, OreFeatureConfig config, double startX, double endX, double startZ, double endZ, - double startY, double endY, int p_x, int p_y, int p_z, int p_horizontalSize, int p_verticalSize, CallbackInfoReturnable cir, - int i, BitSet bitSet, BlockPos.Mutable mutable, int j, double[] ds, ChunkSectionCache chunkSectionCache, int m, double d, double e, - double g, double h, int n, int o, int p, int q, int r, int s, int t, double u, int v, double w, int aa, ChunkSection chunkSection, - int ad, int ae, int af, BlockState blockState, Iterator var57, OreFeatureConfig.Target target) { - - if (!(target.state.isOf(ThingsBlocks.GLEAMING_ORE) || target.state.isOf(ThingsBlocks.DEEPSLATE_GLEAMING_ORE))) return; - THINGS$SEETHING.put(new BlockPos(t, v, aa), target.state); - } - - // now in here we read all the gleaming ore spots from our cache and actually cause a block update so that the - // lighting calculations happen. all of this just so that some dumb orr block can glow. - @Inject(method = "generateVeinPart", at = @At("TAIL")) - private void coping(StructureWorldAccess world, Random random, OreFeatureConfig config, double startX, double endX, double startZ, double endZ, - double startY, double endY, int x, int y, int z, int horizontalSize, int verticalSize, CallbackInfoReturnable cir) { - - THINGS$SEETHING.forEach((blockPos, state) -> { - world.setBlockState(blockPos, state, Block.NOTIFY_ALL); - }); - THINGS$SEETHING.clear(); - } - -} diff --git a/src/main/java/com/glisco/things/mixin/EntityMixin.java b/src/main/java/com/glisco/things/mixin/EntityMixin.java index 1fd9d7c..7685c04 100644 --- a/src/main/java/com/glisco/things/mixin/EntityMixin.java +++ b/src/main/java/com/glisco/things/mixin/EntityMixin.java @@ -2,13 +2,11 @@ import com.glisco.things.Things; import com.glisco.things.items.ThingsItems; -import io.wispforest.owo.ops.ItemOps; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityType; import net.minecraft.entity.ItemEntity; import net.minecraft.entity.MovementType; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; diff --git a/src/main/java/com/glisco/things/mixin/LivingEntityMixin.java b/src/main/java/com/glisco/things/mixin/LivingEntityMixin.java index f1412c2..2f283d0 100644 --- a/src/main/java/com/glisco/things/mixin/LivingEntityMixin.java +++ b/src/main/java/com/glisco/things/mixin/LivingEntityMixin.java @@ -11,7 +11,6 @@ import net.minecraft.entity.effect.StatusEffectInstance; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.text.Text; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; diff --git a/src/main/resources/assets/things/blockstates/deepslate_glowstone_fixture.json b/src/main/resources/assets/things/blockstates/deepslate_glowstone_fixture.json new file mode 100644 index 0000000..611f8ab --- /dev/null +++ b/src/main/resources/assets/things/blockstates/deepslate_glowstone_fixture.json @@ -0,0 +1,30 @@ +{ + "variants": { + "facing=down": { + "model": "things:block/deepslate_glowstone_fixture" + }, + "facing=up": { + "model": "things:block/deepslate_glowstone_fixture", + "x": 180 + }, + "facing=west": { + "model": "things:block/deepslate_glowstone_fixture", + "x": 90, + "y": 90 + }, + "facing=east": { + "model": "things:block/deepslate_glowstone_fixture", + "x": 90, + "y": 270 + }, + "facing=south": { + "model": "things:block/deepslate_glowstone_fixture", + "x": 90 + }, + "facing=north": { + "model": "things:block/deepslate_glowstone_fixture", + "x": 90, + "y": 180 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/things/lang/en_us.json b/src/main/resources/assets/things/lang/en_us.json index 5e3d9f7..97fac68 100644 --- a/src/main/resources/assets/things/lang/en_us.json +++ b/src/main/resources/assets/things/lang/en_us.json @@ -4,6 +4,7 @@ "block.things.stone_glowstone_fixture": "Stone Glowstone Fixture", "block.things.quartz_glowstone_fixture": "Quartz Glowstone Fixture", + "block.things.deepslate_glowstone_fixture": "Deepslate Glowstone Fixture", "block.things.gleaming_ore": "Gleaming Ore", "block.things.deepslate_gleaming_ore": "Deepslate Gleaming Ore", "block.things.diamond_pressure_plate": "Diamond Pressure Plate", diff --git a/src/main/resources/assets/things/models/block/deepslate_glowstone_fixture.json b/src/main/resources/assets/things/models/block/deepslate_glowstone_fixture.json new file mode 100644 index 0000000..e22adf6 --- /dev/null +++ b/src/main/resources/assets/things/models/block/deepslate_glowstone_fixture.json @@ -0,0 +1,266 @@ +{ + "credit": "Made with Blockbench", + "parent": "block/block", + "textures": { + "0": "block/glowstone", + "1": "things:block/deepslate_glowstone_fixture", + "particle": "block/glowstone" + }, + "elements": [ + { + "from": [ + 5, + 0, + 5 + ], + "to": [ + 11, + 1, + 11 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 13, + 8, + 13 + ] + }, + "faces": { + "north": { + "uv": [ + 5, + 5, + 11, + 6 + ], + "texture": "#1" + }, + "east": { + "uv": [ + 5, + 5, + 11, + 6 + ], + "texture": "#1" + }, + "south": { + "uv": [ + 5, + 5, + 11, + 6 + ], + "texture": "#1" + }, + "west": { + "uv": [ + 5, + 5, + 11, + 6 + ], + "texture": "#1" + }, + "up": { + "uv": [ + 5, + 5, + 11, + 11 + ], + "texture": "#1" + }, + "down": { + "uv": [ + 5, + 5, + 11, + 11 + ], + "texture": "#1" + } + } + }, + { + "from": [ + 6, + 1, + 6 + ], + "to": [ + 10, + 2, + 10 + ], + "rotation": { + "angle": 0, + "axis": "y", + "origin": [ + 13, + 9, + 13 + ] + }, + "faces": { + "north": { + "uv": [ + 6, + 14, + 10, + 15 + ], + "texture": "#0" + }, + "east": { + "uv": [ + 6, + 14, + 10, + 15 + ], + "texture": "#0" + }, + "south": { + "uv": [ + 6, + 14, + 10, + 15 + ], + "texture": "#0" + }, + "west": { + "uv": [ + 6, + 14, + 10, + 15 + ], + "texture": "#0" + }, + "up": { + "uv": [ + 3, + 8, + 7, + 12 + ], + "texture": "#0" + }, + "down": { + "uv": [ + 6, + 6, + 10, + 10 + ], + "texture": "#0" + } + } + } + ], + "display": { + "thirdperson_righthand": { + "translation": [ + 0, + 4, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "thirdperson_lefthand": { + "translation": [ + 0, + 4, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "firstperson_righthand": { + "rotation": [ + 0, + 45, + 0 + ], + "translation": [ + 0, + 4.75, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "firstperson_lefthand": { + "rotation": [ + 0, + 45, + 0 + ], + "translation": [ + 0, + 4.75, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "ground": { + "translation": [ + 0, + 2, + 0 + ], + "scale": [ + 0.5, + 0.5, + 0.5 + ] + }, + "gui": { + "rotation": [ + 30, + 225, + 0 + ], + "translation": [ + 0, + 0, + 0 + ], + "scale": [ + 0.625, + 0.625, + 0.625 + ] + }, + "fixed": { + "rotation": [ + -90, + 0, + 0 + ], + "translation": [ + 0, + 0, + -8.5 + ] + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/things/models/item/deepslate_glowstone_fixture.json b/src/main/resources/assets/things/models/item/deepslate_glowstone_fixture.json new file mode 100644 index 0000000..98c6904 --- /dev/null +++ b/src/main/resources/assets/things/models/item/deepslate_glowstone_fixture.json @@ -0,0 +1,3 @@ +{ + "parent": "things:block/deepslate_glowstone_fixture" +} \ No newline at end of file diff --git a/src/main/resources/assets/things/textures/block/deepslate_glowstone_fixture.png b/src/main/resources/assets/things/textures/block/deepslate_glowstone_fixture.png new file mode 100644 index 0000000..68de548 Binary files /dev/null and b/src/main/resources/assets/things/textures/block/deepslate_glowstone_fixture.png differ diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index bb252cb..fa99c53 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -47,7 +47,7 @@ "fabric": "*", "minecraft": ">=1.18.2", "trinkets": ">=3.3.0", - "owo": ">=0.5.4+1.18", + "owo": ">=0.7.2+1.18", "cloth-config": ">=6.0.0", "patchouli": "*", "reach-entity-attributes": "*" diff --git a/src/main/resources/things.mixins.json b/src/main/resources/things.mixins.json index 7732d1e..b98aede 100644 --- a/src/main/resources/things.mixins.json +++ b/src/main/resources/things.mixins.json @@ -11,7 +11,6 @@ "BrewingStandBlockEntityMixin", "BucketItemMixin", "ContainerLockMixin", - "Copenhagen", "EnchantmentHelperMixin", "EntityMixin", "ExplosionBehaviorMixin",