Skip to content

Commit

Permalink
target 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
deirn committed Apr 12, 2023
1 parent 4efe751 commit a868012
Show file tree
Hide file tree
Showing 24 changed files with 111 additions and 150 deletions.
67 changes: 34 additions & 33 deletions buildSrc/src/main/kotlin/Dependencies.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,53 +3,54 @@ import org.gradle.kotlin.dsl.DependencyHandlerScope
import org.gradle.kotlin.dsl.exclude

object versions {
val minecraft = "1.19.2"
val minecraft = "1.19.3"
}

object deps {
val minecraft = "com.mojang:minecraft:${versions.minecraft}"
val yarn = "net.fabricmc:yarn:1.19.2+build.8:v2"
val fabricLoader = "net.fabricmc:fabric-loader:0.14.15"
val yarn = "net.fabricmc:yarn:1.19.3+build.5:v2"
val fabricLoader = "net.fabricmc:fabric-loader:0.14.18"

val wthit = "mcp.mobius.waila:wthit:fabric-5.13.5"
val wthit = "mcp.mobius.waila:wthit:fabric-6.3.1"

val ae2 = "appeng:appliedenergistics2-fabric:12.9.2"
val alloyForge = "maven.modrinth:jhl28YkY:2.0.19+1.19"
val architectury = "dev.architectury:architectury-fabric:6.5.69"
val create = "com.simibubi.create:create-fabric-1.19.2:0.5.0.i-961+1.19.2"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:8.2.88"
val extraGen = "maven.modrinth:VXtwLg17:1.2.1-BETA+1.19"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.73.2+1.19.2"
val flk = "net.fabricmc:fabric-language-kotlin:1.9.1+kotlin.1.8.10"
val kibe = "maven.modrinth:OvlwmUdC:1.9.11-BETA+1.19"
val modernDynamics = "maven.modrinth:fMpvLrnF:0.4.0-alpha"
val modmenu = "com.terraformersmc:modmenu:4.2.0-beta.2"
val noIndium = "me.luligabi:NoIndium:1.1.0+1.19"
val owo = "io.wispforest:owo-lib:0.9.3+1.19"
val patchouli = "vazkii.patchouli:Patchouli:1.19.2-77-FABRIC"
val powah = "maven.modrinth:KZO4S4DO:4.0.6-fabric"
val ae2 = "appeng:appliedenergistics2-fabric:13.0.6-beta"
val alloyForge = "maven.modrinth:jhl28YkY:2.0.19+1.19.3"
val architectury = "dev.architectury:architectury-fabric:7.1.78"
val clothConfig = "me.shedaniel.cloth:cloth-config-fabric:9.0.94"
val fabricApi = "net.fabricmc.fabric-api:fabric-api:0.76.1+1.19.3"
val flk = "net.fabricmc:fabric-language-kotlin:1.9.3+kotlin.1.8.20"
val modmenu = "com.terraformersmc:modmenu:5.1.0-beta.4"
val noIndium = "me.luligabi:NoIndium:1.1.0+1.19.3"
val owo = "io.wispforest:owo-lib:0.10.3+1.19.3"
val patchouli = "vazkii.patchouli:Patchouli:1.19.3-78-FABRIC"

val indrev = "curse.maven:cursemod-391708:4020957"
val luggage = "curse.maven:cursemod-594709:4284469"
val pal = "io.github.ladysnake:PlayerAbilityLib:1.6.0"
val rebornCore = "RebornCore:RebornCore-1.19:5.4.0"
val techReborn = "TechReborn:TechReborn-1.19:5.4.0"
val wirelessNet = "curse.maven:cursemod-461316:3876132"
val pal = "io.github.ladysnake:PlayerAbilityLib:1.7.0"
val rebornCore = "RebornCore:RebornCore-1.19:5.5.0"
val techReborn = "TechReborn:TechReborn-1.19:5.5.0"

object lba {
val core = "alexiil.mc.lib:libblockattributes-core:0.11.1"
val fluids = "alexiil.mc.lib:libblockattributes-fluids:0.11.1"
val items = "alexiil.mc.lib:libblockattributes-items:0.11.1"
val core = "alexiil.mc.lib:libblockattributes-core:0.12.0"
val fluids = "alexiil.mc.lib:libblockattributes-fluids:0.12.0"
val items = "alexiil.mc.lib:libblockattributes-items:0.12.0"
}

val trEnergy = "teamreborn:energy:2.2.0"
val libgui = "io.github.cottonmc:LibGui:6.0.1+1.19"
val trEnergy = "teamreborn:energy:3.0.0"
val libgui = "io.github.cottonmc:LibGui:6.5.3+1.19.3"
val magna = "com.github.GabrielOlvH:magna:0.5.2"
val stepAttr = "com.github.emilyploszaj:step-height-entity-attribute:v1.0.1"
val stepAttr = "com.github.emilyploszaj:step-height-entity-attribute:v1.1.0"
val fakePlayer = "dev.cafeteria:fake-player-api:0.5.0"
val mixinExtras = "com.github.LlamaLad7:MixinExtras:0.1.1-rc.4"
val portingLib = "io.github.fabricators_of_create.Porting-Lib:porting-lib:2.1.811+1.19.2"
val mixinExtras = "com.github.LlamaLad7:MixinExtras:0.2.0-beta.6"
val portingLib = "io.github.fabricators_of_create.Porting-Lib:porting-lib:2.1.852+1.19.3"
val registrate = "com.tterrag.registrate_fabric:Registrate:1.1.50-MC1.19.2"

// val create = "com.simibubi.create:create-fabric-1.19.2:0.5.0.i-961+1.19.2"
// val extraGen = "maven.modrinth:VXtwLg17:1.2.1-BETA+1.19"
// val kibe = "maven.modrinth:OvlwmUdC:1.9.11-BETA+1.19"
// val modernDynamics = "maven.modrinth:fMpvLrnF:0.4.0-alpha"
// val powah = "maven.modrinth:KZO4S4DO:4.0.6-fabric"
// val indrev = "curse.maven:cursemod-391708:4020957"
// val luggage = "curse.maven:cursemod-594709:4284469"
// val wirelessNet = "curse.maven:cursemod-461316:3876132"
}

fun DependencyHandlerScope.modImpl(dep: String, dependencyConfiguration: ExternalModuleDependency.() -> Unit = {}) {
Expand Down
22 changes: 11 additions & 11 deletions buildSrc/src/main/kotlin/FetchLatestVersionsTask.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import version.VersionFetcher
import java.awt.Toolkit
import java.awt.datatransfer.StringSelection
import java.net.http.HttpClient
import java.util.*
import java.util.Locale
import kotlin.reflect.KProperty
import kotlin.reflect.full.memberProperties

Expand Down Expand Up @@ -46,29 +46,29 @@ abstract class FetchLatestVersionsTask : DefaultTask() {
fetch(deps::ae2, mrIds.ae2) { "appeng:appliedenergistics2-fabric:${it.version_number.removePrefix("fabric-")}" }
fetch(deps::alloyForge, mrIds.alloyForge) { it.maven }
fetch(deps::architectury, mrIds.architectury) { "dev.architectury:architectury-fabric:${it.version_number.removeSuffix("+fabric")}" }
fetch(deps::create, mrIds.create) { "com.simibubi.create:create-fabric-1.19.2:${it.version_number}" }
// fetch(deps::create, mrIds.create) { "com.simibubi.create:create-fabric-1.19.2:${it.version_number}" }
fetch(deps::clothConfig, mrIds.clothConfig) { "me.shedaniel.cloth:cloth-config-fabric:${it.version_number.removeSuffix("+fabric")}" }
fetch(deps::extraGen, mrIds.extraGen, "1.19") { it.maven }
// fetch(deps::extraGen, mrIds.extraGen, "1.19") { it.maven }
fetch(deps::fabricApi, mrIds.fabricApi) { "net.fabricmc.fabric-api:fabric-api:${it.version_number}" }
fetch(deps::flk, mrIds.flk) { "net.fabricmc:fabric-language-kotlin:${it.version_number}" }
fetch(deps::kibe, mrIds.kibe) { it.maven }
fetch(deps::modernDynamics, mrIds.modernDynamics) { it.maven }
// fetch(deps::kibe, mrIds.kibe) { it.maven }
// fetch(deps::modernDynamics, mrIds.modernDynamics) { it.maven }
fetch(deps::modmenu, mrIds.modmenu) { "com.terraformersmc:modmenu:${it.version_number}" }
fetch(deps::noIndium, mrIds.noIndium, "1.19") { "me.luligabi:NoIndium:${it.version_number}" }
fetch(deps::owo, mrIds.owo, "1.19") { "io.wispforest:owo-lib:${it.version_number}" }
fetch(deps::noIndium, mrIds.noIndium) { "me.luligabi:NoIndium:${it.version_number}" }
fetch(deps::owo, mrIds.owo) { "io.wispforest:owo-lib:${it.version_number}" }
fetch(deps::patchouli, mrIds.patchouli) { "vazkii.patchouli:Patchouli:${it.version_number.toUpperCase(Locale.ROOT)}" }
fetch(deps::powah, mrIds.powah) { it.maven }
// fetch(deps::powah, mrIds.powah) { it.maven }
}

out()

fetcher(CurseForgeVersionFetcher) {
fetch(deps::indrev, cfIds.indrev) { it.maven }
fetch(deps::luggage, cfIds.luggage) { it.maven }
// fetch(deps::indrev, cfIds.indrev) { it.maven }
// fetch(deps::luggage, cfIds.luggage) { it.maven }
fetch(deps::pal, cfIds.pal) { "io.github.ladysnake:PlayerAbilityLib:${it.download.fileName.removePrefix("pal-")}" }
fetch(deps::rebornCore, cfIds.rebornCore) { "RebornCore:RebornCore-1.19:${it.download.fileName.removePrefix("RebornCore-")}" }
fetch(deps::techReborn, cfIds.techReborn) { "TechReborn:TechReborn-1.19:${it.download.fileName.removePrefix("TechReborn-")}" }
fetch(deps::wirelessNet, cfIds.wirelessNet, "1.19") { it.maven }
// fetch(deps::wirelessNet, cfIds.wirelessNet, "1.19") { it.maven }

out("\nobject lba {")
deps.lba::class.memberProperties.forEach { module ->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;

import static net.minecraft.util.registry.Registry.ITEM;
import net.minecraft.registry.Registries;

public class InventoryComponent implements ITooltipComponent {

Expand All @@ -31,7 +30,7 @@ public InventoryComponent(NbtCompound data, int maxWidth, int maxHeight) {

stacks.clear();
for (int i = 0; i < size; i++) {
Item item = ITEM.get(data.getInt(Keys.I_ID + i));
Item item = Registries.ITEM.get(data.getInt(Keys.I_ID + i));
int count = showCount ? data.getInt(Keys.I_COUNT + i) : 1;
NbtCompound nbt = (NbtCompound) data.get(Keys.I_NBT + i);
if (count <= 0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.Registries;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

public class ProgressComponent implements ITooltipComponent {

Expand Down Expand Up @@ -36,7 +36,7 @@ public void render(MatrixStack matrices, int x, int y, float delta) {
int progressPixel = (int) (data.getInt(Keys.P_PERCENT) / 100F * 22);

for (int i = 0; i < inputCount; i++) {
ItemStack stack = new ItemStack(Registry.ITEM.get(data.getInt(Keys.P_I_ID + i)), data.getInt(Keys.P_I_COUNT + i));
ItemStack stack = new ItemStack(Registries.ITEM.get(data.getInt(Keys.P_I_ID + i)), data.getInt(Keys.P_I_COUNT + i));
stack.setNbt(data.getCompound(Keys.P_I_NBT + i));
if (stack.isEmpty()) {
inputCount--;
Expand All @@ -50,7 +50,7 @@ public void render(MatrixStack matrices, int x, int y, float delta) {
MeganeUtils.drawTexture(matrices, ARROW, x + 2 + (inputCount * 18), y + 1, progressPixel, 16, 0, 0, progressPixel / 22F, 0.5F, 0xFFFFFF);

for (int i = 0; i < outputCount; i++) {
ItemStack stack = new ItemStack(Registry.ITEM.get(data.getInt(Keys.P_O_ID + i)), data.getInt(Keys.P_O_COUNT + i));
ItemStack stack = new ItemStack(Registries.ITEM.get(data.getInt(Keys.P_O_ID + i)), data.getInt(Keys.P_O_COUNT + i));
stack.setNbt(data.getCompound(Keys.P_O_NBT + i));
MeganeUtils.drawStack(stack, x + (inputCount * 18) + 26 + (i * 18), y + 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public void render(MatrixStack matrices, int x, int y, float delta) {
StatusEffect statusEffect = StatusEffect.byRawId(data.getInt(Keys.S_ID + i));
if (statusEffect != null) {
Sprite sprite = manager.getSprite(statusEffect);
RenderSystem.setShaderTexture(0, sprite.getAtlas().getId());
RenderSystem.setShaderTexture(0, sprite.getAtlasId());
DrawableHelper.drawSprite(matrices, x + 20 * i, y, 0, 18, 18, sprite);
MeganeUtils.textRenderer().drawWithShadow(matrices, lv, x + 20 + (20 * i) - MeganeUtils.textRenderer().getWidth(lv), y + 20 - MeganeUtils.textRenderer().fontHeight, 0xFFFFFF);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import mcp.mobius.waila.gui.screen.ConfigScreen;
import mcp.mobius.waila.gui.widget.ButtonEntry;
import mcp.mobius.waila.gui.widget.ConfigListWidget;
import mcp.mobius.waila.util.DisplayUtil;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
Expand All @@ -27,9 +28,9 @@ public BlacklistConfigScreen(Screen parent, Text title, Set<Identifier> set) {
public ConfigListWidget getOptions() {
ConfigListWidget options = new ConfigListWidget(this, client, width, height, 32, height - 32, 26, MeganeUtils.CONFIG::save);
this.set.forEach(value -> options.add(new SetEntry(this, options, value, this.set)));
options.add(new ButtonEntry("config.megane.add", new ButtonWidget(0, 0, 100, 20, ScreenTexts.EMPTY, w ->
options.add(new ButtonEntry("config.megane.add", 100, 20, w ->
options.children().add(options.children().size() - 1, new SetEntry(this, options, null, set))
)));
));
return options;
}

Expand All @@ -53,7 +54,7 @@ static class SetEntry extends ConfigListWidget.Entry {
set.add(this.value);
});

this.removeButton = new ButtonWidget(0, 0, 20, 20, Text.of("X"), w -> {
this.removeButton = DisplayUtil.createButton(0, 0, 20, 20, Text.of("X"), w -> {
set.remove(this.value);
screen.children().remove(this.textField);
screen.children().remove(w);
Expand All @@ -68,12 +69,12 @@ static class SetEntry extends ConfigListWidget.Entry {
public void render(MatrixStack matrices, int index, int rowTop, int rowLeft, int width, int height, int mouseX, int mouseY, boolean hovered, float deltaTime) {
super.render(matrices, index, rowTop, rowLeft, width, height, mouseX, mouseY, hovered, deltaTime);

this.textField.x = rowLeft;
this.textField.y = rowTop;
this.textField.setX(rowLeft);
this.textField.setY(rowTop);
this.textField.render(matrices, mouseX, mouseY, deltaTime);

this.removeButton.x = rowLeft + textField.getWidth() + 2;
this.removeButton.y = rowTop + (height - removeButton.getHeight()) / 2;
this.removeButton.setX(rowLeft + textField.getWidth() + 2);
this.removeButton.setY(rowTop + (height - removeButton.getHeight()) / 2);
this.removeButton.render(matrices, mouseX, mouseY, deltaTime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import mcp.mobius.waila.gui.screen.ConfigScreen;
import mcp.mobius.waila.gui.widget.ButtonEntry;
import mcp.mobius.waila.gui.widget.ConfigListWidget;
import mcp.mobius.waila.util.DisplayUtil;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.gui.widget.TextFieldWidget;
Expand Down Expand Up @@ -39,9 +40,9 @@ public MapConfigScreen(Screen parent, Text title, Map<K, V> map, Function<K, Str
public ConfigListWidget getOptions() {
ConfigListWidget options = new ConfigListWidget(this, client, width, height, 32, height - 32, 26, MeganeUtils.CONFIG::save);
this.map.forEach((key, val) -> options.add(new PairEntry(this, options, keyStr.apply(key), valStr.apply(val), mapApplier, keyPredicate, valPredicate)));
options.add(new ButtonEntry("config.megane.add", new ButtonWidget(0, 0, 100, 20, ScreenTexts.EMPTY, w ->
options.add(new ButtonEntry("config.megane.add", 100, 20, w ->
options.children().add(options.children().size() - 1, new PairEntry(this, options, "", "", mapApplier, keyPredicate, valPredicate))
)));
));
return options;
}

Expand Down Expand Up @@ -83,7 +84,7 @@ static class PairEntry extends ConfigListWidget.Entry {
});
screen.addListener(this.valTextField);

this.removeButton = new ButtonWidget(0, 0, 20, 20, Text.of("X"), w -> {
this.removeButton = DisplayUtil.createButton(0, 0, 20, 20, Text.of("X"), w -> {
consumer.apply(this.key, null, null);
screen.children().remove(this.keyTextField);
screen.children().remove(this.valTextField);
Expand All @@ -97,16 +98,16 @@ static class PairEntry extends ConfigListWidget.Entry {
public void render(MatrixStack matrices, int index, int rowTop, int rowLeft, int width, int height, int mouseX, int mouseY, boolean hovered, float deltaTime) {
super.render(matrices, index, rowTop, rowLeft, width, height, mouseX, mouseY, hovered, deltaTime);

this.keyTextField.x = rowLeft;
this.keyTextField.y = rowTop + (height - keyTextField.getHeight()) / 2;
this.keyTextField.setX(rowLeft);
this.keyTextField.setY(rowTop + (height - keyTextField.getHeight()) / 2);
this.keyTextField.render(matrices, mouseX, mouseY, deltaTime);

this.valTextField.x = rowLeft + textWidth + 4;
this.valTextField.y = keyTextField.y;
this.valTextField.setX(rowLeft + textWidth + 4);
this.valTextField.setY(keyTextField.getY());
this.valTextField.render(matrices, mouseX, mouseY, deltaTime);

this.removeButton.x = rowLeft + (textWidth + 2) * 2;
this.removeButton.y = rowTop + (height - removeButton.getHeight()) / 2;
this.removeButton.setX(rowLeft + (textWidth + 2) * 2);
this.removeButton.setY(rowTop + (height - removeButton.getHeight()) / 2);
this.removeButton.render(matrices, mouseX, mouseY, deltaTime);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import mcp.mobius.waila.gui.widget.value.InputValue;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.screen.ScreenTexts;
import net.minecraft.text.Text;

import static lol.bai.megane.runtime.config.widget.Side.AND;
Expand Down Expand Up @@ -63,7 +62,7 @@ private static CategoryEntry category(String type) {
}

private static ButtonEntry button(String type, ButtonWidget.PressAction pressAction) {
return new ButtonEntry(tlKey(type), new ButtonWidget(0, 0, 100, 20, ScreenTexts.EMPTY, pressAction));
return new ButtonEntry(tlKey(type), 100, 20, pressAction);
}

private static BooleanValue bool(String type, boolean value, boolean defaultValue, Consumer<Boolean> consumer) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,13 @@
import mcp.mobius.waila.api.IServerDataProvider;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.Registries;
import net.minecraft.text.ClickEvent;
import net.minecraft.text.HoverEvent;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.minecraft.util.math.BlockPos;

import static net.minecraft.util.registry.Registry.BLOCK;

public abstract class BlockData implements IServerDataProvider<BlockEntity> {

private static final Text ERROR_TEXT = Text.literal("Something went wrong when retrieving data for this block").styled(style -> style
Expand All @@ -44,7 +43,7 @@ public BlockData(Registry<?> registry, Supplier<MeganeConfig.Base> baseConfig) {
public void appendServerData(NbtCompound data, IServerAccessor<BlockEntity> accessor, IPluginConfig config) {
BlockEntity blockEntity = accessor.getTarget();

if (!baseConfig.get().isEnabled() || baseConfig.get().getBlacklist().contains(BLOCK.getId(blockEntity.getCachedState().getBlock()))) {
if (!baseConfig.get().isEnabled() || baseConfig.get().getBlacklist().contains(Registries.BLOCK.getId(blockEntity.getCachedState().getBlock()))) {
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NbtCompound;
import net.minecraft.registry.Registries;

import static lol.bai.megane.runtime.util.Keys.I_COUNT;
import static lol.bai.megane.runtime.util.Keys.I_HAS;
Expand All @@ -17,7 +18,6 @@
import static lol.bai.megane.runtime.util.Keys.I_SHOW;
import static lol.bai.megane.runtime.util.Keys.I_SIZE;
import static lol.bai.megane.runtime.util.MeganeUtils.EMPTY_TAG;
import static net.minecraft.util.registry.Registry.ITEM;

public class BlockInventoryData extends BlockData {

Expand All @@ -41,7 +41,7 @@ void append(NbtCompound data, IServerAccessor<BlockEntity> accessor) {
if (stack.isEmpty()) {
continue;
}
data.putInt(I_ID + i, ITEM.getRawId(stack.getItem()));
data.putInt(I_ID + i, Registries.ITEM.getRawId(stack.getItem()));
data.putInt(I_COUNT + i, stack.getCount());
NbtCompound nbt = stack.getNbt();
data.put(I_NBT + i, nbt == null || !MeganeUtils.config().inventory.isNbt() ? EMPTY_TAG : nbt);
Expand Down
Loading

0 comments on commit a868012

Please sign in to comment.