Skip to content

Commit

Permalink
Update to 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
Roundaround committed Dec 7, 2024
1 parent b09b356 commit a649730
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 24 deletions.
4 changes: 3 additions & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
plugins {
id("roundalib") version "0.7.0-SNAPSHOT"
id("fabric-loom") version "1.9-SNAPSHOT"
id("com.gradleup.shadow") version "9.0.0-beta2"
id("roundalib") version "0.9.0-SNAPSHOT"
}
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ org.gradle.parallel=true
group_id=me.roundaround
mod_id=armorstands
mod_version=2.0.0
minecraft_version=1.21
yarn_mappings=build.9
loader_version=0.15.11
fabric_version=0.102.0
roundalib_version=2.0.0
mod_menu_version=11.0.1
minecraft_version=1.21.2
yarn_mappings=build.1
loader_version=0.16.9
fabric_version=0.106.1
roundalib_version=2.3.0
mod_menu_version=12.0.0-beta.1
dev_login_version=3.5
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public boolean shouldPassEvents() {
public void init() {
this.populateLayout();
this.collectElements();
this.initTabNavigation();
this.refreshWidgetPositions();
}

protected MinecraftClient getClient() {
Expand Down Expand Up @@ -179,7 +179,7 @@ protected void collectElements() {
}

@Override
protected void initTabNavigation() {
protected void refreshWidgetPositions() {
this.layout.refreshPositions();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package me.roundaround.armorstands.client.gui.screen;

import com.google.common.collect.ImmutableList;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.datafixers.util.Pair;
import me.roundaround.armorstands.ArmorStandsMod;
import me.roundaround.armorstands.client.network.ClientNetworking;
Expand All @@ -11,6 +10,7 @@
import me.roundaround.roundalib.client.gui.widget.ToggleWidget;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.InventoryScreen;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.screen.slot.Slot;
import net.minecraft.util.Identifier;
Expand Down Expand Up @@ -62,10 +62,10 @@ private boolean getFlagValue(ArmorStandFlag flag) {
}

@Override
protected void initTabNavigation() {
protected void refreshWidgetPositions() {
this.x = (this.width - BACKGROUND_WIDTH) / 2;
this.y = (this.height - BACKGROUND_HEIGHT) / 2;
super.initTabNavigation();
super.refreshWidgetPositions();
}

@Override
Expand All @@ -78,9 +78,9 @@ public void render(DrawContext context, int mouseX, int mouseY, float delta) {

@Override
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
RenderSystem.setShaderColor(1f, 1f, 1f, 1f);

context.drawTexture(CUSTOM_TEXTURE, this.x, this.y, 0, 0, BACKGROUND_WIDTH, BACKGROUND_HEIGHT);
context.drawTexture(RenderLayer::getGuiTextured, CUSTOM_TEXTURE, this.x, this.y, 0, 0, BACKGROUND_WIDTH,
BACKGROUND_HEIGHT, 256, 256
);

ImmutableList<Pair<Slot, EquipmentSlot>> armorSlots = this.handler.getArmorSlots();
for (int index = 0; index < armorSlots.size(); index++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,8 @@ private ToggleWidget createToggleWidget(ArmorStandFlag flag) {
.setHeight(BUTTON_HEIGHT)
.labelBgColor(BACKGROUND_COLOR)
.build();
this.subscriptions.add(this.values.get(flag).subscribe(
(value) -> widget.setValue(value ^ flag.invertControl()),
Observable.SubscribeOptions.builder().withHardReference().build()
));
this.subscriptions.add(this.values.get(flag)
.subscribe((value) -> widget.setValue(value ^ flag.invertControl()), Observable.SubscribeOptions.create()));
return widget;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public boolean getValue(ArmorStandEntity armorStand) {
ArmorStandEntityAccessor accessor = (ArmorStandEntityAccessor) armorStand;

return switch (this) {
case HIDE_BASE_PLATE -> armorStand.shouldHideBasePlate();
case HIDE_BASE_PLATE -> !armorStand.shouldShowBasePlate();
case SHOW_ARMS -> armorStand.shouldShowArms();
case SMALL -> armorStand.isSmall();
case NO_GRAVITY -> armorStand.hasNoGravity();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,6 @@ private boolean tryTransferToOffHand(ItemStack stack) {
}

public static boolean isSlotDisabled(ArmorStandEntity armorStand, EquipmentSlot slot) {
return (((ArmorStandEntityAccessor) armorStand).getDisabledSlots() & 1 << slot.getArmorStandSlotId()) != 0;
return (((ArmorStandEntityAccessor) armorStand).getDisabledSlots() & 1 << slot.getEntitySlotId()) != 0;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public static void setScale(ArmorStandEntity armorStand, float scale, boolean ro
}
}

EntityAttributeInstance attribute = armorStand.getAttributes().getCustomInstance(EntityAttributes.GENERIC_SCALE);
EntityAttributeInstance attribute = armorStand.getAttributes().getCustomInstance(EntityAttributes.SCALE);
if (attribute != null) {
attribute.setBaseValue(target);
}
Expand Down
1 change: 0 additions & 1 deletion src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
}
},
"depends": {
"fabricloader": ">=0.15.11",
"fabric-api": "*",
"minecraft": "1.21.*"
}
Expand Down

0 comments on commit a649730

Please sign in to comment.