Skip to content

Commit

Permalink
Screen scaling fix on Forge 1.20.1 version, and bumped the version. M…
Browse files Browse the repository at this point in the history
…ade the naming scheme the same as the fabric version.
  • Loading branch information
Creativious committed Sep 30, 2023
1 parent 168fc85 commit 2d2bc34
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 16 deletions.
2 changes: 2 additions & 0 deletions platform-forge-1.20.1/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
id 'net.minecraftforge.gradle' version '[6.0,6.2)'
}

mod_version = "${mod_version}-${minecraft_version}-FORGE"

version = mod_version
group = mod_group_id

Expand Down
2 changes: 1 addition & 1 deletion platform-forge-1.20.1/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ mod_name=Fake Players
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved
# The mod version. See https://semver.org/
mod_version=0.7.6+1.20.1
mod_version=0.7.7
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ public FPSkinScreen(Component component, FakePlayerEntity humanoid, Player playe
@Override
protected void init() {
super.init();
int l = this.height / 4 + 48;
int l = ((this.height - this.imageHeight) / 2) + (int) (this.imageHeight * 0.05);
int i = (this.width - this.imageWidth) / 2;
int j = (this.height - this.imageWidth) / 2;

int j = this.imageWidth - (int) ( this.imageWidth * 0.1);
assert this.minecraft != null;
this.input = new EditBox(this.minecraft.fontFilterFishy, (i) + (this.imageWidth/2) - j + (j/2),l,j, 12, Component.translatable("screen.fakeplayers.skin"));
this.input.setValue(this.humanoid.getURL());
Expand All @@ -55,40 +55,49 @@ protected void init() {
if (FPClientConfigs.USES_FILES.get()) {
this.input.setValue("PUT FILE PATH HERE!");
}

this.chatBox = new EditBox(this.minecraft.fontFilterFishy, (i) + (this.imageWidth/2) - j + (j/2),l + 20,j, 12, Component.translatable("screen.fakeplayers.chatbox"));
int after_input_edit_box_y = this.input.getY() + this.input.getHeight() + ((int) (this.height * 0.01));

this.chatBox = new EditBox(this.minecraft.fontFilterFishy, (i) + (this.imageWidth/2) - j + (j/2),after_input_edit_box_y,j, 12, Component.translatable("screen.fakeplayers.chatbox"));
this.chatBox.setValue("Input chat message here!");
this.chatBox.setEditable(true);
this.chatBox.setMaxLength(100);
this.chatBox.setBordered(true);
this.addWidget(this.chatBox);

int after_chat_edit_box_y = this.chatBox.getY() + this.chatBox.getHeight() + ((int) (this.height * 0.02));

this.send = new Button.Builder(Component.translatable("screens.fakeplayers.send"), (p_96786_) -> {
this.pressSendChatButton();
}).bounds((i) + (this.imageWidth/2) - (98/2),l + 40,98,20).build();
}).bounds((i) + (this.imageWidth/2) - (98/2),after_chat_edit_box_y,98,20).build();
this.addRenderableWidget(this.send);

this.confirm = new Button.Builder(Component.translatable("screens.fakeplayers.done"), (p_96786_) -> {
this.pressDoneButton();
}).bounds((i) + (this.imageWidth/2) - (98/2),l + (128),98,20).build();
this.addRenderableWidget(this.confirm);

int after_send_button_y = this.send.getY() + this.send.getHeight() + ((int) (this.height * 0.05));

this.sitting = new Button.Builder(Component.translatable("screens.fakeplayers.sit"), (p_96786_) -> {
this.pressToggleSit();
}).bounds((i) + (this.imageWidth/2) - (23), l + 80,46,20).build();
}).bounds((i) + (this.imageWidth/2) - (23), after_send_button_y,46,20).build();
this.addRenderableWidget(this.sitting);

int after_sitting_button_y = this.sitting.getY() + this.sitting.getHeight();
this.stayPut = new Button.Builder(Component.translatable("screens.fakeplayers.stayPut"), (p_96786_) -> {
this.pressStayPut();
}).bounds((i) + (this.imageWidth/2) - 23, l + 100,46,20).build();
}).bounds((i) + (this.imageWidth/2) - 23, after_sitting_button_y,46,20).build();
this.addRenderableWidget(this.stayPut);
this.wander = new Button.Builder(Component.translatable("screens.fakeplayers.wander"), (p_96786_) -> {
this.pressWanderButton();
}).bounds((i) + (this.imageWidth/2) - (23*3), l + 100,46,20).build();
}).bounds((i) + (this.imageWidth/2) - (23*3), after_sitting_button_y,46,20).build();
this.addRenderableWidget(this.wander);
this.follow = new Button.Builder(Component.translatable("screens.fakeplayers.follow"), (p_96786_) -> {
this.pressFollowButton();
}).bounds((i) + (this.imageWidth/2) + 23, l + 100,46,20).build();
}).bounds((i) + (this.imageWidth/2) + 23, after_sitting_button_y,46,20).build();
this.addRenderableWidget(this.follow);

int after_other_buttons_y = this.follow.getY() + this.follow.getHeight() + ((int) (this.height * 0.02));

this.confirm = new Button.Builder(Component.translatable("screens.fakeplayers.done"), (p_96786_) -> {
this.pressDoneButton();
}).bounds((i) + (this.imageWidth/2) - (98/2),after_other_buttons_y,98,20).build();
this.addRenderableWidget(this.confirm);
}


Expand Down

0 comments on commit 2d2bc34

Please sign in to comment.