mirror of
https://github.com/darksaid98/Flashback.git
synced 2026-12-02 06:28:48 +00:00
Update to 1.21.3
This commit is contained in:
1 parent
bc06f67861
commit
8c02fd7430
56 files changed
+609
-573
No files matched your search
@@ -30,6 +30,7 @@ import net.minecraft.server.WorldStem;
|
||||
import net.minecraft.server.packs.repository.PackRepository;
|
||||
import net.minecraft.server.packs.repository.ServerPacksSource;
|
||||
import net.minecraft.world.Difficulty;
|
||||
import net.minecraft.world.flag.FeatureFlagSet;
|
||||
import net.minecraft.world.flag.FeatureFlags;
|
||||
import net.minecraft.world.level.DataPackConfig;
|
||||
import net.minecraft.world.level.GameRules;
|
||||
@@ -151,15 +152,16 @@ public class CombineReplayScreen extends Screen {
|
||||
packRepository.reload();
|
||||
|
||||
WorldDataConfiguration worldDataConfiguration = new WorldDataConfiguration(new DataPackConfig(List.of(), List.of()), FeatureFlags.DEFAULT_FLAGS);
|
||||
LevelSettings levelSettings = new LevelSettings("Replay", GameType.SPECTATOR, false, Difficulty.NORMAL, true, new GameRules(), worldDataConfiguration);
|
||||
LevelSettings levelSettings = new LevelSettings("Replay", GameType.SPECTATOR, false, Difficulty.NORMAL, true, new GameRules(FeatureFlagSet.of()),
|
||||
worldDataConfiguration);
|
||||
WorldLoader.PackConfig packConfig = new WorldLoader.PackConfig(packRepository, worldDataConfiguration, false, true);
|
||||
WorldLoader.InitConfig initConfig = new WorldLoader.InitConfig(packConfig, Commands.CommandSelection.DEDICATED, 4);
|
||||
|
||||
WorldStem worldStem = Util.blockUntilDone(executor -> WorldLoader.load(initConfig, dataLoadContext -> {
|
||||
Registry<LevelStem> registry = new MappedRegistry<>(Registries.LEVEL_STEM, Lifecycle.stable()).freeze();
|
||||
|
||||
Holder.Reference<Biome> plains = dataLoadContext.datapackWorldgen().registryOrThrow(Registries.BIOME).getHolder(Biomes.PLAINS).get();
|
||||
Holder.Reference<DimensionType> overworld = dataLoadContext.datapackWorldgen().registryOrThrow(Registries.DIMENSION_TYPE).getHolder(BuiltinDimensionTypes.OVERWORLD).get();
|
||||
Holder.Reference<Biome> plains = dataLoadContext.datapackWorldgen().lookupOrThrow(Registries.BIOME).get(Biomes.PLAINS).get();
|
||||
Holder.Reference<DimensionType> overworld = dataLoadContext.datapackWorldgen().lookupOrThrow(Registries.DIMENSION_TYPE).get(BuiltinDimensionTypes.OVERWORLD).get();
|
||||
|
||||
WorldDimensions worldDimensions = new WorldDimensions(Map.of(LevelStem.OVERWORLD, new LevelStem(overworld, new EmptyLevelSource(plains))));
|
||||
WorldDimensions.Complete complete = worldDimensions.bake(registry);
|
||||
|
||||
@@ -3,6 +3,7 @@ package com.moulberry.flashback.screen;
|
||||
import net.minecraft.client.gui.Font;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.client.gui.components.Button;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
|
||||
@@ -25,7 +26,7 @@ public class FlashbackButton extends Button {
|
||||
int x = this.getX() + paddingX;
|
||||
int y = this.getY() + paddingY;
|
||||
|
||||
guiGraphics.blit(ICON_PIXELATED, x, y, 0f, 0f, size, size, size, size);
|
||||
guiGraphics.blit(RenderType::guiTextured, ICON_PIXELATED, x, y, 0f, 0f, size, size, size, size);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.client.gui.components.toasts.SystemToast;
|
||||
import net.minecraft.client.gui.narration.NarrationElementOutput;
|
||||
import net.minecraft.client.gui.navigation.CommonInputs;
|
||||
import net.minecraft.client.gui.screens.*;
|
||||
import net.minecraft.client.renderer.RenderType;
|
||||
import net.minecraft.client.resources.language.I18n;
|
||||
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
|
||||
import net.minecraft.network.chat.CommonComponents;
|
||||
@@ -348,7 +349,7 @@ public class ReplaySelectionList extends ObjectSelectionList<ReplaySelectionList
|
||||
|
||||
@Override
|
||||
public void render(GuiGraphics guiGraphics, int index, int y, int x, int width, int height, int mouseX, int mouseY, boolean hovered, float partialTick) {
|
||||
guiGraphics.blitSprite(SPRITES.get(true, hovered), x + 4, y + 2, width - 8, height - 4);
|
||||
guiGraphics.blitSprite(RenderType::guiTextured, SPRITES.get(true, hovered), x + 4, y + 2, width - 8, height - 4);
|
||||
|
||||
int p = (this.minecraft.screen.width - this.minecraft.font.width(LOAD_REPLAY_LABEL)) / 2;
|
||||
int q = y + (height - this.minecraft.font.lineHeight) / 2 + 1;
|
||||
@@ -411,7 +412,7 @@ public class ReplaySelectionList extends ObjectSelectionList<ReplaySelectionList
|
||||
guiGraphics.drawString(this.minecraft.font, info, x + ICON_WIDTH + 3, y + this.minecraft.font.lineHeight + this.minecraft.font.lineHeight + 3, 0xFF808080, false);
|
||||
|
||||
RenderSystem.enableBlend();
|
||||
guiGraphics.blit(this.icon.textureLocation(), x, y, 0.0f, 0.0f, 32, 32, 32, 32);
|
||||
guiGraphics.blit(RenderType::guiTextured, this.icon.textureLocation(), x, y, 0.0f, 0.0f, 32, 32, 32, 32);
|
||||
RenderSystem.disableBlend();
|
||||
|
||||
if (this.minecraft.options.touchscreen().get() || hovered) {
|
||||
@@ -431,7 +432,7 @@ public class ReplaySelectionList extends ObjectSelectionList<ReplaySelectionList
|
||||
} else {
|
||||
iconOverlay = hoveredIcon ? JOIN_HIGHLIGHTED_SPRITE : JOIN_SPRITE;
|
||||
}
|
||||
guiGraphics.blitSprite(iconOverlay, x, y, ICON_WIDTH, ICON_HEIGHT);
|
||||
guiGraphics.blitSprite(RenderType::guiTextured, iconOverlay, x, y, ICON_WIDTH, ICON_HEIGHT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user