Skip to content

Commit

Permalink
Update to 1.21 (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
granny authored Jun 18, 2024
1 parent 4763784 commit e0eb1c9
Show file tree
Hide file tree
Showing 14 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ dependencies {
minecraft("com.mojang:minecraft:${project.minecraft_version}")
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-${minecraft_version}:${project.parchment_version}@zip")
//parchment("org.parchmentmc.data:parchment-${minecraft_version}:${project.parchment_version}@zip") // TODO: update when available
}
modImplementation("net.fabricmc:fabric-loader:${project.loader_version}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.fabric_version}")
Expand Down
10 changes: 5 additions & 5 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
org.gradle.jvmargs=-Xmx2G

minecraft_version=1.20.6
loader_version=0.15.10
parchment_version=2024.05.01
fabric_version=0.97.8+1.20.6
modmenu_version=10.0.0-beta.1
minecraft_version=1.21
loader_version=0.15.11
#parchment_version=2024.05.01 # TODO: update when available
fabric_version=0.100.1+1.21
modmenu_version=11.0.0-beta.1
configurate_version=4.1.2

maven_group=org.purpurmc.purpur.client
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/purpurmc/purpur/client/config/Seats.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public void setAllSeats(double x, double y, double z) {
allay.setSeat(z, y, z);
armadillo.setSeat(z, y, z);
axolotl.setSeat(z, y, z);
allay.setSeat(z, y, z);
bat.setSeat(z, y, z);
bee.setSeat(z, y, z);
blaze.setSeat(z, y, z);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.server.packs.resources.ResourceManager;

public class SplashTexture extends SimpleTexture {
public static final ResourceLocation SPLASH = new ResourceLocation("purpurclient", "textures/splash.png");
public static final ResourceLocation SPLASH = ResourceLocation.fromNamespaceAndPath("purpurclient", "textures/splash.png");

public SplashTexture() {
super(SPLASH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.screens.OptionsSubScreen;
import net.minecraft.client.gui.screens.options.OptionsSubScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,10 @@ public void init() {
this.fakePlayer.startRiding(this.fakeEntity, true);
}

@Override
protected void addOptions() {
}

@Override
public void render(GuiGraphics context, int mouseX, int mouseY, float delta) {
renderBackground(context, mouseX, mouseY, delta);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import net.minecraft.client.gui.components.AbstractWidget;
import net.minecraft.client.gui.components.MobsList;
import net.minecraft.client.gui.components.OptionsList;
import net.minecraft.client.gui.screens.OptionsSubScreen;
import net.minecraft.client.gui.screens.options.OptionsSubScreen;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.network.chat.MutableComponent;
Expand All @@ -17,16 +17,15 @@
public class MobsScreen extends OptionsSubScreen {
public final static MutableComponent MOBS_BTN = Component.translatable("purpurclient.options.mobs");

protected OptionsList options;
protected int centerX;

public MobsScreen(Screen screen) {
super(screen, Minecraft.getInstance().options, MOBS_BTN);
}

@Override
protected void init() {
MobsList widget = new MobsList(this.minecraft, this.height, this.height, this);
protected void addContents() {
MobsList widget = new MobsList(this.minecraft, this.height, this);

int amount = 15;
List<AbstractWidget> list = new ArrayList<>();
Expand All @@ -38,19 +37,16 @@ protected void init() {
}
}
widget.addEntry(list);
this.options = this.addRenderableWidget(widget);
super.init();
this.list = this.layout.addToContents(widget);
}

@Override
public void renderBackground(GuiGraphics context, int mouseX, int mouseY, float delta) {
super.renderBackground(context, mouseX, mouseY, delta);
context.fillGradient(0, 0, this.width, this.height, 0x800F4863, 0x80370038);
protected void addOptions() {
}

@Override
protected void repositionElements() {
super.repositionElements();
this.options.updateSize(this.width, this.layout);
public void renderBackground(GuiGraphics context, int mouseX, int mouseY, float delta) {
super.renderBackground(context, mouseX, mouseY, delta);
context.fillGradient(0, 0, this.width, this.height, 0x800F4863, 0x80370038);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
public class DoubleButton extends AbstractWidget implements Tickable {
private final static Component PLUS = Component.nullToEmpty("+");
private final static Component MINUS = Component.nullToEmpty("-");
private static final WidgetSprites TEXTURES = new WidgetSprites(new ResourceLocation("widget/button"), new ResourceLocation("widget/button_disabled"), new ResourceLocation("widget/button_highlighted"));
private static final WidgetSprites TEXTURES = new WidgetSprites(ResourceLocation.parse("widget/button"), ResourceLocation.parse("widget/button_disabled"), ResourceLocation.parse("widget/button_highlighted"));

private final DoubleOption option;
private int tooltipDelay;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
public class MobButton extends SpriteIconButton {
public static final int MOBS_ATLAS_WIDTH = 512;
public static final int MOBS_TEXTURE_WIDTH = 16;
public static final ResourceLocation MOBS_TEXTURE = new ResourceLocation("purpurclient", "textures/mobs.png");
public static final ResourceLocation MOBS_TEXTURE = ResourceLocation.fromNamespaceAndPath("purpurclient", "textures/mobs.png");

public MobButton(Minecraft client, Screen screen, Mob mob) {
super(MOBS_TEXTURE_WIDTH, MOBS_TEXTURE_WIDTH,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import net.minecraft.client.gui.GuiGraphics;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.narration.NarratableEntry;
import net.minecraft.client.gui.screens.OptionsSubScreen;
import net.minecraft.client.gui.screens.options.OptionsSubScreen;
import net.minecraft.client.gui.screens.Screen;
import org.jetbrains.annotations.Nullable;

Expand All @@ -22,8 +22,8 @@ public class MobsList extends OptionsList {
private static final int DEFAULT_ITEM_HEIGHT = 25;
private final OptionsSubScreen screen;

public MobsList(Minecraft minecraft, int width, int height, OptionsSubScreen screen) {
super(minecraft, width, height, screen);
public MobsList(Minecraft minecraft, int width, OptionsSubScreen screen) {
super(minecraft, width, screen);
this.screen = screen;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void render(GuiGraphics context, int mouseX, int mouseY, float delta, Cal
this.delta = 0;
opacity = Mth.clamp(g, 0.0f, 1.0f);
} else {
this.delta += this.minecraft.getFrameTime();
this.delta += this.minecraft.getTimer().getRealtimeDeltaTicks();
opacity = Mth.clampedLerp(-0.5F, 1.0F, this.delta / 30F);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

public record ClientboundBeehivePayload(BlockPos pos, int numOfBees) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ClientboundBeehivePayload> STREAM_CODEC = CustomPacketPayload.codec(ClientboundBeehivePayload::write, ClientboundBeehivePayload::new);
public static final Type<ClientboundBeehivePayload> TYPE = new Type<>(new ResourceLocation("purpur", "beehive_s2c"));
public static final Type<ClientboundBeehivePayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath("purpur", "beehive_s2c"));
public static String NUM_OF_BEES = null;

public ClientboundBeehivePayload(FriendlyByteBuf friendlyByteBuf) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

public record ServerboundBeehivePayload(BlockPos pos) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundBeehivePayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundBeehivePayload::write, ServerboundBeehivePayload::new);
public static final Type<ServerboundBeehivePayload> TYPE = new Type<>(new ResourceLocation("purpur", "beehive_c2s"));
public static final Type<ServerboundBeehivePayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath("purpur", "beehive_c2s"));

public ServerboundBeehivePayload(FriendlyByteBuf friendlyByteBuf) {
this(friendlyByteBuf.readBlockPos());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public record ServerboundPurpurClientHelloPayload(int protocol) implements CustomPacketPayload {
public static final StreamCodec<FriendlyByteBuf, ServerboundPurpurClientHelloPayload> STREAM_CODEC = CustomPacketPayload.codec(ServerboundPurpurClientHelloPayload::write, ServerboundPurpurClientHelloPayload::new);
public static final Type<ServerboundPurpurClientHelloPayload> TYPE = new Type<>(new ResourceLocation("purpur", "client"));
public static final Type<ServerboundPurpurClientHelloPayload> TYPE = new Type<>(ResourceLocation.fromNamespaceAndPath("purpur", "client"));
public static final int PROTOCOL = 0;

public ServerboundPurpurClientHelloPayload(){
Expand Down

0 comments on commit e0eb1c9

Please sign in to comment.