Skip to content

Commit

Permalink
[v2.6.0+1.20] support minecraft 1.20.5/1.20.6 (temporarily disable in…
Browse files Browse the repository at this point in the history
…tegration with other mods) (#73)

* updated github actions

* removed client mixin

* bump deps

* fixed cauldron behavior

* replaced setInvStackList with setHeldStacks

* updated ReinforcedShulkerBoxBlock

* updated recipe impls

* fixed ShulkerBoxBlockMixin target

* replaced FabricBlockSettings with AbstractBlock.Settings

* fixed recipes

* fixed loot tables

* temporarilly disabled mod integration

* bump mod version to v2.6.0+1.20
  • Loading branch information
Aton-Kish authored May 5, 2024
1 parent 106b8a7 commit 0deb042
Show file tree
Hide file tree
Showing 193 changed files with 1,063 additions and 3,278 deletions.
1 change: 0 additions & 1 deletion .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ jobs:
matrix:
# Use these Java versions
java: [
17, # minimum supported by Minecraft
21, # Current Java LTS
]
runs-on: ubuntu-22.04
Expand Down
62 changes: 31 additions & 31 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,20 @@ repositories {
url "https://maven.shedaniel.me/"
}

// Quick Shulker
maven {
url "https://maven.kyrptonaught.dev"
}

// Shulker Box Tooltip
maven {
url "https://maven.misterpemodder.com/libs-release"
}

// Fabric ASM (Shulker Box Tooltip deps)
maven {
url "https://jitpack.io"
}
// // Quick Shulker
// maven {
// url "https://maven.kyrptonaught.dev"
// }

// // Shulker Box Tooltip
// maven {
// url "https://maven.misterpemodder.com/libs-release"
// }

// // Fabric ASM (Shulker Box Tooltip deps)
// maven {
// url "https://jitpack.io"
// }
}

loom {
Expand Down Expand Up @@ -77,13 +77,13 @@ dependencies {
// Reinforced Chests
modImplementation "atonkish.reinfchest:reinforced-chests:${project.reinforced_chests_version}"

// Quick Shulker
modImplementation "net.kyrptonaught:quickshulker:${project.quick_shulker_version}"
// Quick Shulker deps
modImplementation "net.kyrptonaught:shulkerutils:${project.shulkerutils_version}"
// // Quick Shulker
// modImplementation "net.kyrptonaught:quickshulker:${project.quick_shulker_version}"
// // Quick Shulker deps
// modImplementation "net.kyrptonaught:shulkerutils:${project.shulkerutils_version}"

// Shulker Box Tooltip
modImplementation "com.misterpemodder:shulkerboxtooltip-fabric:${project.shulker_box_tooltip_version}"
// // Shulker Box Tooltip
// modImplementation "com.misterpemodder:shulkerboxtooltip-fabric:${project.shulker_box_tooltip_version}"
}

processResources {
Expand All @@ -96,7 +96,7 @@ processResources {

tasks.withType(JavaCompile).configureEach {
// Minecraft 1.18 (1.18-pre2) upwards uses Java 17.
it.options.release = 17
it.options.release = 21
}

java {
Expand All @@ -105,8 +105,8 @@ java {
// If you remove this line, sources will not be generated.
withSourcesJar()

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}

jar {
Expand Down Expand Up @@ -150,16 +150,16 @@ curseforge {
changelog = "[v${project.version}](https://github.com/Aton-Kish/reinforced-shulker-boxes/releases/tag/v" + java.net.URLEncoder.encode(project.version, "UTF-8") + ")"

addGameVersion "Fabric"
addGameVersion "Java 17"
addGameVersion "1.20.3"
addGameVersion "1.20.4"
addGameVersion "Java 21"
addGameVersion "1.20.5"
addGameVersion "1.20.6"

relations {
requiredDependency "fabric-api"
embeddedLibrary "cloth-config"
optionalDependency "modmenu"
optionalDependency "shulkerboxtooltip"
optionalDependency "quick-shulker"
// optionalDependency "shulkerboxtooltip"
// optionalDependency "quick-shulker"
optionalDependency "reinforced-chests"
}
}
Expand All @@ -176,15 +176,15 @@ modrinth {
versionType = "release"
changelog = "[v${project.version}](https://github.com/Aton-Kish/reinforced-shulker-boxes/releases/tag/v" + java.net.URLEncoder.encode(project.version, "UTF-8") + ")"

gameVersions = ["1.20.3", "1.20.4"]
gameVersions = ["1.20.5", "1.20.6"]
loaders = ["fabric"]

dependencies {
required.project "fabric-api"
embedded.project "cloth-config"
optional.project "modmenu"
optional.project "shulkerboxtooltip"
optional.project "quickshulker"
// optional.project "shulkerboxtooltip"
// optional.project "quickshulker"
optional.project "reinforced-chests"
}
}
20 changes: 10 additions & 10 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,24 @@ org.gradle.parallel=true

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
minecraft_version=1.20.6
yarn_mappings=1.20.6+build.1
loader_version=0.15.10

# Mod Properties
mod_version=2.5.3+1.20.4
mod_version=2.6.0+1.20
mod_id=reinfshulker
maven_group=atonkish.reinfshulker
archives_base_name=reinforced-shulker-boxes

# Dependencies
fabric_version=0.97.0+1.20.4
reinforced_core_version=3.1.4+1.20.4
reinforced_chests_version=2.4.5+1.20.4
quick_shulker_version=1.4.0-1.20
shulker_box_tooltip_version=4.0.8+1.20.4
# Quick Shulker deps
shulkerutils_version=1.0.4-1.19
fabric_version=0.97.8+1.20.6
reinforced_core_version=3.1.4+1.20
reinforced_chests_version=2.4.6+1.20
# quick_shulker_version=1.4.0-1.20
# shulker_box_tooltip_version=4.0.8+1.20.4
# # Quick Shulker deps
# shulkerutils_version=1.0.4-1.19

# Distribution platform
curseforge_id=529874
Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions src/client/resources/reinfshulker.client.mixins.json

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Hand;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
Expand Down Expand Up @@ -51,7 +50,7 @@ public <T extends BlockEntity> BlockEntityTicker<T> getTicker(World world, Block
}

@Override
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand,
public ActionResult onUse(BlockState state, World world, BlockPos pos, PlayerEntity player,
BlockHitResult hit) {
if (world.isClient) {
return ActionResult.SUCCESS;
Expand All @@ -78,7 +77,7 @@ private static boolean canOpen(BlockState state, World world, BlockPos pos, Shul
if (entity.getAnimationStage() != ShulkerBoxBlockEntity.AnimationStage.CLOSED) {
return true;
} else {
Box box = ShulkerEntity.calculateBoundingBox((Direction) state.get(FACING), 0.0F, 0.5F).offset(pos)
Box box = ShulkerEntity.calculateBoundingBox(1.0F, (Direction) state.get(FACING), 0.0F, 0.5F).offset(pos)
.contract(1.0E-6D);
return world.isSpaceEmpty(box);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,13 @@
package atonkish.reinfshulker.block.cauldron;

import it.unimi.dsi.fastutil.objects.Object2ObjectOpenHashMap;

import java.util.Map;

import net.minecraft.block.Block;
import net.minecraft.block.LeveledCauldronBlock;
import net.minecraft.block.cauldron.CauldronBehavior;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ActionResult;
import net.minecraft.util.DyeColor;
import net.minecraft.util.Util;
import net.minecraft.util.ItemActionResult;

import atonkish.reinfcore.util.ReinforcingMaterial;
import atonkish.reinfshulker.block.ModBlocks;
Expand All @@ -20,48 +16,33 @@
import atonkish.reinfshulker.stat.ModStats;

public class ModCauldronBehavior {
public static final Map<Item, CauldronBehavior> CLEAN_REINFORCED_SHULKER_BOX_MAP;
private static final CauldronBehavior CLEAN_REINFORCED_SHULKER_BOX;

public static void init() {
}

static Object2ObjectOpenHashMap<Item, CauldronBehavior> createMap() {
return Util.make(new Object2ObjectOpenHashMap<>(), (map) -> {
map.defaultReturnValue((state, world, pos, player, hand, stack) -> {
return ActionResult.PASS;
});
});
Map<Item, CauldronBehavior> map = CauldronBehavior.WATER_CAULDRON_BEHAVIOR.map();
for (Map<DyeColor, Item> materialShulkerBoxMap : ModItems.REINFORCED_SHULKER_BOX_MAP.values()) {
for (DyeColor color : DyeColor.values()) {
map.put(materialShulkerBoxMap.get(color), CLEAN_REINFORCED_SHULKER_BOX);
}
}
}

static {
CLEAN_REINFORCED_SHULKER_BOX = (state, world, pos, player, hand, stack) -> {
Block block = Block.getBlockFromItem(stack.getItem());
if (!(block instanceof ReinforcedShulkerBoxBlock)) {
return ActionResult.PASS;
return ItemActionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION;
} else {
if (!world.isClient) {
ReinforcingMaterial material = ((ReinforcedShulkerBoxBlock) block).getMaterial();
ItemStack itemStack = new ItemStack(
ModBlocks.REINFORCED_SHULKER_BOX_MAP.get(material).get((DyeColor) null));
if (stack.hasNbt()) {
itemStack.setNbt(stack.getNbt().copy());
}

player.setStackInHand(hand, itemStack);
player.setStackInHand(hand, stack.copyComponentsToNewStack(
ModBlocks.REINFORCED_SHULKER_BOX_MAP.get(material).get((DyeColor) null), 1));
player.incrementStat(ModStats.CLEAN_REINFORCED_SHULKER_BOX_MAP.get(material));
LeveledCauldronBlock.decrementFluidLevel(state, world, pos);
}

return ActionResult.success(world.isClient);
return ItemActionResult.success(world.isClient);
}
};

CLEAN_REINFORCED_SHULKER_BOX_MAP = createMap();
for (Map<DyeColor, Item> materialShulkerBoxMap : ModItems.REINFORCED_SHULKER_BOX_MAP.values()) {
for (DyeColor color : DyeColor.values()) {
CLEAN_REINFORCED_SHULKER_BOX_MAP.put(materialShulkerBoxMap.get(color), CLEAN_REINFORCED_SHULKER_BOX);
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ public ReinforcedShulkerBoxBlockEntity(ReinforcingMaterial material, @Nullable D
BlockState state) {
super(color, pos, state);
((BlockEntityAccessor) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
this.setInvStackList(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.setHeldStacks(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.cachedMaterial = material;
}

public ReinforcedShulkerBoxBlockEntity(ReinforcingMaterial material, BlockPos pos, BlockState state) {
super(pos, state);
((BlockEntityAccessor) this).setType(ModBlockEntityType.REINFORCED_SHULKER_BOX_MAP.get(material));
this.setInvStackList(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.setHeldStacks(DefaultedList.ofSize(material.getSize(), ItemStack.EMPTY));
this.cachedMaterial = material;
}

Expand Down

This file was deleted.

Loading

0 comments on commit 0deb042

Please sign in to comment.