Skip to content

Commit

Permalink
finalize 1.20.1 update
Browse files Browse the repository at this point in the history
  • Loading branch information
LLytho committed Sep 10, 2023
1 parent fbace58 commit 8197796
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

## [0.3.0] - 2023-09-10
- Update to KubeJS 6.3 1.20.1

## [0.2.0] - 2023-07-18
- Update to KubeJS 6.1

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ public void add(BlockPos pos, BlockState state, @Nullable CompoundTag tag) {
"Invalid position, z must be between 0 and " + borderSize.getZ());

StructureTemplate.StructureBlockInfo info = get(pos);
if (info instanceof StructureBlockInfoModification mod) {
//noinspection ConstantValue
if (((Object)info) instanceof StructureBlockInfoModification mod) { // Direct cast seems not to work anymore. Have fun with this.
mod.setVanillaBlockState(state);
mod.setNbt(tag);
return;
Expand All @@ -61,7 +62,7 @@ public void forEach(Consumer<StructureTemplate.StructureBlockInfo> consumer) {
public void removeIf(Predicate<StructureTemplate.StructureBlockInfo> predicate) {
palette.blocks().removeIf(block -> {
if (predicate.test(block)) {
cache.remove(block.pos);
cache.remove(block.pos());
return true;
}
return false;
Expand All @@ -71,7 +72,7 @@ public void removeIf(Predicate<StructureTemplate.StructureBlockInfo> predicate)
@Nullable
public StructureTemplate.StructureBlockInfo get(BlockPos pos) {
if (cache.isEmpty()) {
forEach(info -> cache.put(info.pos, info));
forEach(info -> cache.put(info.pos(), info));
}

return cache.get(pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import dev.latvian.mods.kubejs.bindings.TextWrapper;
import dev.latvian.mods.kubejs.script.ScriptType;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.screens.inventory.AbstractContainerScreen;
import net.minecraft.client.gui.screens.inventory.EnchantmentScreen;
import net.minecraft.network.chat.Component;
Expand All @@ -31,8 +32,9 @@ public EnchantmentScreenMixin(EnchantmentMenu abstractContainerMenu, Inventory i
super(abstractContainerMenu, inventory, component);
}

@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/screens/inventory/EnchantmentScreen;renderComponentTooltip(Lcom/mojang/blaze3d/vertex/PoseStack;Ljava/util/List;II)V"), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
private void render$InvokeEnchantmentTooltipMenu(PoseStack ps, int mx, int my, float pTick, CallbackInfo ci, boolean creative, int goldCount, int slot, int cost, Enchantment enchantment, int lClue, int level, List<Component> currentComponents) {
@Inject(method = "render", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiGraphics;renderComponentTooltip(Lnet/minecraft/client/gui/Font;Ljava/util/List;II)V"), locals = LocalCapture.CAPTURE_FAILEXCEPTION)
// PoseStack ps, int mx, int my, float pTick, CallbackInfo ci, boolean creative, int goldCount, int slot, int cost, Enchantment enchantment, int lClue, int level, List<Component> currentComponents
private void render$InvokeEnchantmentTooltipMenu(GuiGraphics graphics, int mx, int my, float pTick, CallbackInfo ci, boolean creative, int goldCount, int slot, int cost, Enchantment enchantment, int lClue, int level, List<Component> currentComponents) {
if (Minecraft.getInstance().level == null || Minecraft.getInstance().player == null) {
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Forge/src/main/resources/META-INF/mods.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ side = "BOTH"
[[dependencies.${modId}]]
modId = "minecraft"
mandatory = true
versionRange = "[1.19,1.20)"
versionRange = "[1.20.1,)"
ordering = "NONE"
side = "BOTH"

Expand Down
4 changes: 2 additions & 2 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Project
version = 0.2.0
version = 0.3.0
group = com.almostreliable.morejs
license = GNU Lesser General Public License v3.0
mixinVersion = 0.8.5
Expand All @@ -17,7 +17,7 @@ fabricLoaderVersion = 0.14.21

# Dependencies
extraModsDirectory = extra-mods
kubejsVersion = 2001.6.2-build.15
kubejsVersion = 2001.6.3-build.38
rhinoVersion = 2001.2.2-build.6
architecturyVersion = 9.1.12
reiVersion = 12+
Expand Down

0 comments on commit 8197796

Please sign in to comment.