forked from MrCrayfish/MrCrayfishDeviceMod
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
120 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
common/src/main/java/com/ultreon/devices/core/client/LaptopFontSet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package com.ultreon.devices.core.client; | ||
|
||
import com.mojang.blaze3d.font.GlyphInfo; | ||
import net.minecraft.client.gui.font.FontSet; | ||
import com.mojang.blaze3d.font.IGlyph; | ||
import net.minecraft.client.gui.font.Font; | ||
import net.minecraft.client.renderer.texture.TextureManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* @author Qboi123 | ||
*/ | ||
public class LaptopFontSet extends FontSet { | ||
private static final GlyphInfo TAB_INFO = () -> 16.0f; | ||
public class LaptopFont extends Font { | ||
private static final IGlyph TAB_INFO = () -> 16.0f; | ||
|
||
public LaptopFontSet(TextureManager pTextureManager, ResourceLocation pName) { | ||
public LaptopFont(TextureManager pTextureManager, ResourceLocation pName) { | ||
super(pTextureManager, pName); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public GlyphInfo getGlyphInfoForSpace(int i) { | ||
return i == 9 ? TAB_INFO : super.getGlyphInfoForSpace(i); | ||
public IGlyph getIGlyphForSpace(int i) { | ||
return i == 9 ? TAB_INFO : super.getIGlyphForSpace(i); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
accessWidener v2 named | ||
accessible method net/minecraft/client/gui/font/FontSet getGlyphInfoForSpace (I)Lcom/mojang/blaze3d/font/GlyphInfo; | ||
extendable method net/minecraft/client/gui/font/FontSet getGlyphInfoForSpace (I)Lcom/mojang/blaze3d/font/GlyphInfo; | ||
accessible method net/minecraft/client/gui/Font getFontSet (Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/gui/font/FontSet; | ||
accessible method net/minecraft/client/gui/font/Font getIGlyphForSpace (I)Lcom/mojang/blaze3d/font/IGlyph; | ||
extendable method net/minecraft/client/gui/font/Font getIGlyphForSpace (I)Lcom/mojang/blaze3d/font/IGlyph; | ||
accessible method net/minecraft/client/gui/Font getFont (Lnet/minecraft/resources/ResourceLocation;)Lnet/minecraft/client/gui/font/Font; | ||
accessible field net/minecraft/client/Minecraft fontManager Lnet/minecraft/client/gui/font/FontManager; | ||
accessible method net/minecraft/client/renderer/LevelRenderer renderEntity (Lnet/minecraft/world/entity/Entity;DDDFLcom/mojang/blaze3d/vertex/PoseStack;Lnet/minecraft/client/renderer/MultiBufferSource;)V |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
src/main/java/com/ultreon/devices/core/client/LaptopFontSet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
package com.ultreon.devices.core.client; | ||
|
||
import com.mojang.blaze3d.font.GlyphInfo; | ||
import net.minecraft.client.gui.font.FontSet; | ||
import net.minecraft.client.gui.fonts.Font; | ||
import net.minecraft.client.gui.fonts.IGlyph; | ||
import net.minecraft.client.renderer.texture.TextureManager; | ||
import net.minecraft.util.ResourceLocation; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
/** | ||
* @author Qboi123 | ||
*/ | ||
public class LaptopFontSet extends FontSet { | ||
private static final GlyphInfo TAB_INFO = () -> 16.0f; | ||
public class LaptopFontSet extends Font { | ||
private static final IGlyph TAB_INFO = () -> 16.0f; | ||
|
||
public LaptopFontSet(TextureManager pTextureManager, ResourceLocation pName) { | ||
super(pTextureManager, pName); | ||
} | ||
|
||
@Nullable | ||
@Override | ||
public GlyphInfo getGlyphInfoForSpace(int i) { | ||
return i == 9 ? TAB_INFO : super.getGlyphInfoForSpace(i); | ||
public IGlyph getGlyphInfo(int i) { | ||
return i == 9 ? TAB_INFO : super.getGlyphInfo(i); | ||
} | ||
} |
70 changes: 29 additions & 41 deletions
70
src/main/java/com/ultreon/devices/core/client/debug/ClientAppDebug.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,50 +1,38 @@ | ||
package com.ultreon.devices.core.client.debug; | ||
|
||
import com.ultreon.devices.DeviceConfig; | ||
import com.ultreon.devices.block.entity.LaptopBlockEntity; | ||
import com.ultreon.devices.core.Laptop; | ||
import com.ultreon.devices.core.laptop.client.ClientLaptop; | ||
import com.ultreon.devices.core.laptop.client.ClientLaptopScreen; | ||
import com.ultreon.devices.core.laptop.server.ServerLaptop; | ||
import dev.architectury.event.events.client.ClientGuiEvent; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.client.gui.widget.button.Button; | ||
import net.minecraft.client.gui.screens.TitleScreen; | ||
import net.minecraft.util.text.StringTextComponent; | ||
|
||
/** | ||
* Adds a button to the title screen to test system applications that don't require the system | ||
*/ | ||
public class ClientAppDebug { | ||
public static void register() { | ||
if (DeviceConfig.DEBUG_BUTTON.get()) { | ||
ClientGuiEvent.INIT_POST.register(((screen, access) -> { | ||
if (!(screen instanceof TitleScreen)) return; | ||
int rowHeight = 24; | ||
var y = screen.height / 4 + 48; | ||
|
||
Button a = new Button(screen.width / 2 - 100, y + rowHeight * -2, 200, 20, new StringTextComponent("DV TEST"), (button) -> { | ||
Minecraft.getInstance().setScreen(new Laptop(new LaptopBlockEntity(), true)); | ||
}, Button.NO_TOOLTIP); | ||
access.addRenderableWidget(a); | ||
})); | ||
|
||
|
||
ClientGuiEvent.INIT_POST.register(((screen, access) -> { | ||
if (!(screen instanceof TitleScreen)) return; | ||
int rowHeight = 24; | ||
var y = screen.height / 4 + 48; | ||
|
||
Button a = new Button(screen.width / 2 - 100, y + rowHeight * -3, 200, 20, new StringTextComponent("DV TEST #2"), (button) -> { | ||
ServerLaptop serverLaptop = new ServerLaptop(); | ||
ServerLaptop.laptops.put(serverLaptop.getUuid(), serverLaptop); | ||
ClientLaptop clientLaptop = new ClientLaptop(); | ||
clientLaptop.setUuid(serverLaptop.getUuid()); | ||
ClientLaptop.laptops.put(clientLaptop.getUuid(), clientLaptop); | ||
Minecraft.getInstance().setScreen(new ClientLaptopScreen(clientLaptop)); | ||
}, Button.NO_TOOLTIP); | ||
access.addRenderableWidget(a); | ||
})); | ||
} | ||
// if (DeviceConfig.DEBUG_BUTTON.get()) { | ||
// ClientGuiEvent.INIT_POST.register(((screen, access) -> { | ||
// if (!(screen instanceof TitleScreen)) return; | ||
// int rowHeight = 24; | ||
// var y = screen.height / 4 + 48; | ||
// | ||
// Button a = new Button(screen.width / 2 - 100, y + rowHeight * -2, 200, 20, new StringTextComponent("DV TEST"), (button) -> { | ||
// Minecraft.getInstance().setScreen(new Laptop(new LaptopBlockEntity(), true)); | ||
// }, Button.NO_TOOLTIP); | ||
// access.addRenderableWidget(a); | ||
// })); | ||
// | ||
// | ||
// ClientGuiEvent.INIT_POST.register(((screen, access) -> { | ||
// if (!(screen instanceof TitleScreen)) return; | ||
// int rowHeight = 24; | ||
// var y = screen.height / 4 + 48; | ||
// | ||
// Button a = new Button(screen.width / 2 - 100, y + rowHeight * -3, 200, 20, new StringTextComponent("DV TEST #2"), (button) -> { | ||
// ServerLaptop serverLaptop = new ServerLaptop(); | ||
// ServerLaptop.laptops.put(serverLaptop.getUuid(), serverLaptop); | ||
// ClientLaptop clientLaptop = new ClientLaptop(); | ||
// clientLaptop.setUuid(serverLaptop.getUuid()); | ||
// ClientLaptop.laptops.put(clientLaptop.getUuid(), clientLaptop); | ||
// Minecraft.getInstance().setScreen(new ClientLaptopScreen(clientLaptop)); | ||
// }, Button.NO_TOOLTIP); | ||
// access.addRenderableWidget(a); | ||
// })); | ||
// } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.