Skip to content

Commit

Permalink
Update to 1.21.2
Browse files Browse the repository at this point in the history
  • Loading branch information
samolego committed Oct 16, 2024
1 parent e07c335 commit 1e035f9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 35 deletions.
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '1.6-SNAPSHOT'
id 'fabric-loom' version '1.8.9'
id 'maven-publish'
id "com.matthewprenger.cursegradle" version "1.4.0"
id "com.modrinth.minotaur" version "2.+"
Expand Down Expand Up @@ -40,11 +40,11 @@ dependencies {
modImplementation(include("com.github.samolego.Config2Brigadier:config2brigadier-fabric:${project.c2b_lib_version}"))

// LuckPerms
modImplementation(include('me.lucko:fabric-permissions-api:0.2-SNAPSHOT'))
modImplementation(include('me.lucko:fabric-permissions-api:0.3.1'))

// Carpet
modCompileOnly("com.github.gnembon:fabric-carpet:${project.carpet_core_version}")
modCompileOnly('com.github.samolego.Taterzens:taterzens-fabric:1.11.6')
modImplementation("carpet:fabric-carpet:1.21.2-pre3-${project.carpet_core_version}")
//modCompileOnly('com.github.samolego.Taterzens:taterzens-fabric:1.11.6')
}

processResources {
Expand Down
13 changes: 7 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Done to increase the memory available to gradle.
org.gradle.jvmargs=-Xmx1G
# Fabric Properties
minecraft_version=1.21
yarn_mappings=1.21+build.2
loader_version=0.15.11
minecraft_version=1.21.2-pre5
yarn_mappings=1.21.2-pre5+build.2
loader_version=0.16.7

# Fabric API
fabric_version=0.99.4+1.21
fabric_version=0.106.0+1.21.2

# Mod Properties
mod_version=2.5.0
mod_version=2.5.1
maven_group=org.samo_lego
archives_base_name=fabrictailor
# Dependencies
c2b_lib_version=1.2.3
carpet_core_version=1.4.147
carpet_core_version=1.4.157+v241014
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void onInitializeClient() {
if (TAILORED_SERVER || forceOpen) {
client.setScreen(SKIN_CHANGE_SCREEN);
} else {
client.player.sendSystemMessage(TextTranslations.create("error.fabrictailor.not_installed").withStyle(ChatFormatting.RED));
client.player.displayClientMessage(TextTranslations.create("error.fabrictailor.not_installed").withStyle(ChatFormatting.RED), false);
forceOpen = true;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.advancements.AdvancementsScreen;
import net.minecraft.client.gui.screens.inventory.InventoryScreen;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.network.chat.CommonComponents;
import net.minecraft.network.chat.Component;
import net.minecraft.network.protocol.common.custom.CustomPacketPayload;
Expand Down Expand Up @@ -228,7 +229,7 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta)

// Window texture
RenderSystem.enableBlend();
guiGraphics.blit(AdvancementsScreen.WINDOW_LOCATION, startX, startY, 0, 0, 252, 140);
guiGraphics.blit(RenderType::guiTextured, AdvancementsScreen.WINDOW_LOCATION, startX, startY, 0, 0, 252, 140, 256, 256);


// Render input field
Expand All @@ -239,23 +240,13 @@ public void render(GuiGraphics guiGraphics, int mouseX, int mouseY, float delta)
this.drawIcons(guiGraphics, startX, startY);
this.drawWidgetTooltips(guiGraphics, startX, startY, mouseX, mouseY);


int x = this.startX + 24;
int y = this.startY - 76;
if (this.selectedTab.showModelBackwards()) {
float mousex = -(((float) width / 2) - 75 - mouseX);
float mousey = ((float) height / 2) - mouseY;
var player = minecraft.player;
float f = (float) Math.atan(mousex / 40.0f);
float g = (float) Math.atan(mousey / 40.0f);

int x = this.startX + 24;
int y = this.startY - 76;
renderEntityInInventoryFollowsMouseBackwards(guiGraphics, x, y, x + 75, y + 208, 48, 1.0f, mouseX + 2, mouseY - 16, this.minecraft.player);

} else {
// Drawing Player
// Luckily vanilla code is available
int x = this.startX + 24;
int y = this.startY - 76;
InventoryScreen.renderEntityInInventoryFollowsMouse(guiGraphics, x, y, x + 75, y + 208, 48, 1.0f, mouseX + 2, mouseY - 16, this.minecraft.player);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
import com.mojang.authlib.properties.Property;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.server.level.ServerPlayer;
import org.samo_lego.taterzens.interfaces.ITaterzenEditor;
import org.samo_lego.taterzens.npc.TaterzenNPC;
//import org.samo_lego.taterzens.interfaces.ITaterzenEditor;
//import org.samo_lego.taterzens.npc.TaterzenNPC;

public class TaterzenSkins {

public static boolean setTaterzenSkin(ServerPlayer executor, Property skinData) {
TaterzenNPC taterzen = ((ITaterzenEditor) executor).getNpc();
/*TaterzenNPC taterzen = ((ITaterzenEditor) executor).getNpc();
if (taterzen != null) {
CompoundTag skinTag = new CompoundTag();
Expand All @@ -19,7 +19,7 @@ public static boolean setTaterzenSkin(ServerPlayer executor, Property skinData)
taterzen.setSkinFromTag(skinTag);
taterzen.sendProfileUpdates();
return true;
}
}*/
return false;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.network.protocol.game.ClientboundPlayerInfoUpdatePacket;
import net.minecraft.network.protocol.game.ClientboundPlayerPositionPacket;
import net.minecraft.network.protocol.game.ClientboundRespawnPacket;
import net.minecraft.network.protocol.game.ClientboundSetCarriedItemPacket;
import net.minecraft.network.protocol.game.ClientboundSetCursorItemPacket;
import net.minecraft.network.protocol.game.ClientboundSetEquipmentPacket;
import net.minecraft.network.protocol.game.ClientboundSetExperiencePacket;
import net.minecraft.network.protocol.game.ClientboundSetHealthPacket;
Expand All @@ -28,6 +28,7 @@
import net.minecraft.server.players.PlayerList;
import net.minecraft.world.effect.MobEffectInstance;
import net.minecraft.world.entity.EquipmentSlot;
import net.minecraft.world.entity.PositionMoveRotation;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
Expand Down Expand Up @@ -121,14 +122,15 @@ public void fabrictailor_reloadSkin() {
level.isDebug(),
level.isFlat(),
self.getLastDeathLocation(),
this.getPortalCooldown()
this.getPortalCooldown(),
level.getSeaLevel()
),
(byte) 3
ClientboundRespawnPacket.KEEP_ALL_DATA
)
);

this.connection.send(new ClientboundPlayerPositionPacket(self.getX(), self.getY(), self.getZ(), self.getYRot(), self.getXRot(), Collections.emptySet(), 0));
this.connection.send(new ClientboundSetCarriedItemPacket(this.getInventory().selected));
this.connection.send(new ClientboundPlayerPositionPacket(0, PositionMoveRotation.of(self), Collections.emptySet()));
this.connection.send(new ClientboundSetCursorItemPacket(this.getInventory().getSelected()));

this.connection.send(new ClientboundChangeDifficultyPacket(level.getDifficulty(), level.getLevelData().isDifficultyLocked()));
this.connection.send(new ClientboundSetExperiencePacket(this.experienceProgress, this.totalExperience, this.experienceLevel));
Expand Down

0 comments on commit 1e035f9

Please sign in to comment.