Skip to content

Commit

Permalink
target 1.21.4
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Dec 5, 2024
1 parent 5976b99 commit 042a315
Show file tree
Hide file tree
Showing 15 changed files with 35 additions and 27 deletions.
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ org.gradle.jvmargs = -Xmx3G
org.gradle.parallel = true
org.gradle.caching = true

minecraft = 1.21.3
minecraft = 1.21.4

archiveBaseName = wthit
group = mcp.mobius.waila
majorVersion = 13
majorVersion = 14

# [rei, jei, emi]
recipeViewer = none
Expand All @@ -16,13 +16,13 @@ rei = 13.0.666
jei = 1.20.2-16.0.0.28
emi = 1.0.23+1.20.2

fabricLoader = 0.16.7
fabricApi = 0.106.1+1.21.3
fabricLoader = 0.16.9
fabricApi = 0.110.5+1.21.4
modMenu = 10.0.0-alpha.3
trEnergy = 3.0.0

forge = 53.0.13
neo = 21.3.0-beta
neo = 21.4.5-beta

architectury = 10.0.7
clothConfig = 12.0.107
Expand Down
4 changes: 2 additions & 2 deletions platform/fabric/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
cf.endpoint = minecraft.curseforge.com
cf.projectId = 440979
cf.releaseType = stable
cf.gameVersion = 1.21.3
cf.gameVersion = 1.21.4
cf.loader = Fabric, Quilt
cf.require = fabric-api, badpackets
cf.optional = modmenu, roughly-enough-items, jei, emi

# Modrinth
mr.projectId = 6AQIaxuO
mr.releaseType = stable
mr.gameVersion = 1.21.3
mr.gameVersion = 1.21.4
mr.loader = fabric, quilt
mr.require = P7dR8mSH, ftdbN0KK
mr.optional = mOgUt4GM, nfn13YXA, fRiHVvU7
4 changes: 2 additions & 2 deletions platform/neo/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
cf.endpoint = minecraft.curseforge.com
cf.projectId = 455982
cf.releaseType = beta
cf.gameVersion = 1.21.3
cf.gameVersion = 1.21.4
cf.loader = NeoForge
cf.require = badpackets
cf.optional = jei

# Modrinth
mr.projectId = 6AQIaxuO
mr.releaseType = beta
mr.gameVersion = 1.21.3
mr.gameVersion = 1.21.4
mr.loader = neoforge
mr.require = ftdbN0KK
mr.optional = 1PfY6b5p
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ public class NeoApiService extends ApiService {
@Override
@SuppressWarnings("DataFlowIssue")
public IModInfo getModInfo(ItemStack stack) {
return ModInfo.get(stack.getItem().getCreatorModId(stack));
return super.getModInfo(stack);
// TODO use Neo's method
// return ModInfo.get(stack.getItem().getCreatorModId(stack));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void register(IClientRegistrar registrar) {
registrar.toolType(ResourceLocation.withDefaultNamespace("shears"), IToolType.builder()
.lowestTierItem(Items.SHEARS)
.blockPredicate(it -> /*it.is(BlockTags.SHEARS_MINEABLE) ||*/ it.getBlock() instanceof IShearable || it.getBlock() instanceof DoublePlantBlock)
.itemTag(ConventionalItemTags.SHEARS_TOOLS)
.itemTag(ConventionalItemTags.SHEAR_TOOLS)
.build());
}

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ platform("mojmap")

//platform("bukkit")
platform("fabric")
platform("forge")
//platform("forge")
platform("neo")
platform("textile")
//platform("quilt")
2 changes: 1 addition & 1 deletion src/main/java/mcp/mobius/waila/access/ClientAccessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public void set(Level world, Player player, HitResult hit, Entity viewEntity, Ve
public void setState(BlockState state) {
this.state = state;
this.block = state.getBlock();
this.stack = block.getCloneItemStack(world, pos, state);
this.stack = state.getCloneItemStack(world, pos, true);
this.blockRegistryName = BuiltInRegistries.BLOCK.getKey(block);
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mcp/mobius/waila/gui/screen/CreditsScreen.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ private ListWidget(Minecraft client, int width, int height, int top, int itemHei
private void init() {
var totalHeight = (children().size() - 1) * itemHeight;
if (totalHeight < height) {
setRenderHeader(true, (height - totalHeight) / 2 - getY());
headerHeight = (height - totalHeight) / 2 - getY();
}
}

Expand All @@ -103,7 +103,7 @@ public int getRowWidth() {
}

@Override
protected int getScrollbarPosition() {
protected int scrollBarX() {
return minecraft.getWindow().getGuiScaledWidth() - 5;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public int getRowWidth() {
}

@Override
protected int getScrollbarPosition() {
protected int scrollBarX() {
return minecraft.getWindow().getGuiScaledWidth() - 5;
}

Expand Down Expand Up @@ -127,7 +127,7 @@ public void init() {
}

resize(topOffset, owner.height + bottomOffset);
setScrollAmount(getScrollAmount());
setScrollAmount(scrollAmount());
}

public void add(Entry entry) {
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/mcp/mobius/waila/service/ApiService.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
import net.minecraft.world.item.TippedArrowItem;
import net.minecraft.world.item.ToolMaterial;
import net.minecraft.world.item.alchemy.PotionContents;
import net.minecraft.world.item.component.CustomData;
import net.minecraft.world.item.enchantment.ItemEnchantments;
import net.minecraft.world.level.block.Block;
import org.joml.Matrix4f;
Expand Down Expand Up @@ -70,9 +71,12 @@ public IModInfo getModInfo(ItemStack stack) {
var id = BuiltInRegistries.POTION.getKey(potion.value());
if (id != null) return IModInfo.get(id);
}
} else if (item instanceof SpawnEggItem spawnEggItem) {
var id = BuiltInRegistries.ENTITY_TYPE.getKey(spawnEggItem.getType(stack));
return IModInfo.get(id.getNamespace());
} else if (item instanceof SpawnEggItem) {
var customData = stack.getOrDefault(DataComponents.ENTITY_DATA, CustomData.EMPTY);
if (!customData.isEmpty()) {
var id = customData.parseEntityId();
if (id != null) return IModInfo.get(id);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
@Mixin(AbstractFurnaceBlockEntity.class)
public interface AbstractFurnaceBlockEntityAccess {

@Accessor("cookingProgress")
int wthit_cookingProgress();
@Accessor("cookingTimer")
int wthit_cookingTimer();

@Accessor("cookingTotalTime")
int wthit_cookingTotalTime();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package mcp.mobius.waila.mixin;

import mcp.mobius.waila.mixed.IShearable;
import net.minecraft.world.level.block.CherryLeavesBlock;
import net.minecraft.world.level.block.DeadBushBlock;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.MangroveLeavesBlock;
Expand All @@ -13,7 +12,6 @@


@Mixin({
CherryLeavesBlock.class,
DeadBushBlock.class,
LeavesBlock.class,
MangroveLeavesBlock.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public enum BlockProvider implements IBlockComponentProvider {

@Override
public ITooltipComponent getIcon(IBlockAccessor accessor, IPluginConfig config) {
return new ItemComponent(accessor.getBlock().getCloneItemStack(accessor.getWorld(), accessor.getPosition(), accessor.getBlockState()));
return new ItemComponent(accessor.getBlockState().getCloneItemStack(accessor.getWorld(), accessor.getPosition(), true));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import mcp.mobius.waila.api.IThemeAccessor;
import mcp.mobius.waila.api.IThemeType;
import mcp.mobius.waila.api.IntFormat;
import mcp.mobius.waila.api.WailaConstants;
import net.minecraft.client.DeltaTracker;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
Expand Down Expand Up @@ -43,6 +44,8 @@ public enum Mode {
TILE, STRETCH
}

private static final ResourceLocation PATH_TEXTURE_ID = ResourceLocation.fromNamespaceAndPath(WailaConstants.NAMESPACE, "nine_patch_path");

private String texture;
private boolean useResourcePack;
private int textColor;
Expand Down Expand Up @@ -70,7 +73,8 @@ public void processProperties(IThemeAccessor accessor) {
} else {
try {
var image = NativeImage.read(Files.newInputStream(accessor.getPath(texture)));
textureId = Minecraft.getInstance().getTextureManager().register("waila_9p", new DynamicTexture(image));
textureId = PATH_TEXTURE_ID;
Minecraft.getInstance().getTextureManager().register(textureId, new DynamicTexture(image));
} catch (Exception e) {
textureId = TextureManager.INTENTIONAL_MISSING_TEXTURE;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public void appendData(IDataWriter data, IServerAccessor<AbstractFurnaceBlockEnt
var access = (AbstractFurnaceBlockEntityAccess) furnace;

if (furnace.getBlockState().getValue(AbstractFurnaceBlock.LIT)) res.add(ProgressData
.ratio((float) access.wthit_cookingProgress() / access.wthit_cookingTotalTime())
.ratio((float) access.wthit_cookingTimer() / access.wthit_cookingTotalTime())
.itemGetter(furnace::getItem)
.input(0, 1)
.output(2));
Expand Down

0 comments on commit 042a315

Please sign in to comment.