Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
4.0.1.0 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
JT122406 committed Nov 11, 2023
1 parent 1076cb8 commit dffe741
Show file tree
Hide file tree
Showing 199 changed files with 1,647 additions and 1,825 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.world.inventory.SimpleContainerData;
import net.minecraft.world.inventory.Slot;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;
import potionstudios.byg.common.container.BYGMenuTypes;

public class HypogealImperiumContainer extends AbstractContainerMenu {
Expand Down Expand Up @@ -51,7 +52,7 @@ public HypogealImperiumContainer(int windowId, Inventory playerInv, Container in
}

@Override
public ItemStack quickMoveStack(Player playerIn, int index) {
public @NotNull ItemStack quickMoveStack(@NotNull Player playerIn, int index) {
ItemStack itemstack = ItemStack.EMPTY;
Slot slot = this.slots.get(index);
if (slot != null && slot.hasItem()) {
Expand All @@ -75,7 +76,7 @@ public ItemStack quickMoveStack(Player playerIn, int index) {


@Override
public boolean stillValid(Player playerIn) {
public boolean stillValid(@NotNull Player playerIn) {
return this.inventory.stillValid(playerIn);
}

Expand All @@ -88,7 +89,7 @@ public CrystalSlot(Container p_i47069_1_, int p_i47069_2_, int p_i47069_3_, int
super(p_i47069_1_, p_i47069_2_, p_i47069_3_, p_i47069_4_);
}

public boolean mayPlace(ItemStack stack) {
public boolean mayPlace(@NotNull ItemStack stack) {
return true;
}

Expand All @@ -102,7 +103,7 @@ public NumberSlot(Container p_i47069_1_, int p_i47069_2_, int p_i47069_3_, int p
super(p_i47069_1_, p_i47069_2_, p_i47069_3_, p_i47069_4_);
}

public boolean mayPlace(ItemStack stack) {
public boolean mayPlace(@NotNull ItemStack stack) {
return false;
}

Expand All @@ -111,7 +112,7 @@ public int getMaxStackSize() {
}

@Override
public boolean mayPickup(Player p_82869_1_) {
public boolean mayPickup(@NotNull Player p_82869_1_) {
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import org.jetbrains.annotations.NotNull;

public class AbstractBiomepediaScreen extends Screen {

Expand Down Expand Up @@ -39,7 +40,7 @@ protected void init() {


@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
renderBackgroundAndBiomepedia(poseStack);

super.render(poseStack, mouseX, mouseY, partialTick);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,7 @@ protected void init() {
this.toolTipMaxWidth = (IMAGE_WIDTH / 2) - 22;
this.textStartHeight = (this.bottomPos + IMAGE_HEIGHT / 2) - 5;

this.addRenderableWidget(new PageButton(pageButtonForwardX, pageButtonY, true, button -> {
this.minecraft.setScreen(new BiomeAboutScreen2(this.biomeKey, this.parent));
}, true));
this.addRenderableWidget(new PageButton(pageButtonForwardX, pageButtonY, true, button -> this.minecraft.setScreen(new BiomeAboutScreen2(this.biomeKey, this.parent)), true));


int dimensionTextTop = this.bottomPos + 15;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ protected BiomeAboutScreen2(ResourceKey<Biome> biomeKey, Screen parent) {

Map<ResourceKey<Biome>, ObjectOpenHashSet<ResourceKey<EntityType<?>>>> biomeMobs = levelBiomeTracker.getBiomeMobs();
if (biomeMobs.containsKey(biomeKey)) {
biomeMobs.get(biomeKey).stream().sorted(Comparator.comparing(key -> key.location().toString())).forEach(entityTypeResourceKey -> {
mobSpawnsText.append("\n").append(BuiltInRegistries.ENTITY_TYPE.getOrThrow(entityTypeResourceKey).getDescription());
});
biomeMobs.get(biomeKey).stream().sorted(Comparator.comparing(key -> key.location().toString())).forEach(entityTypeResourceKey -> mobSpawnsText.append("\n").append(BuiltInRegistries.ENTITY_TYPE.getOrThrow(entityTypeResourceKey).getDescription()));
} else {
mobSpawnsText.append("\n").append(Component.translatable("biomepedia.biomeabout.mobspawns.none"));
}
Expand Down Expand Up @@ -85,9 +83,7 @@ protected void init() {
int mobSpawnsTextBottom = mobSpawnsTextTop + size;
this.toolTipMaxWidth = (IMAGE_WIDTH / 2) - 22;

this.addRenderableWidget(new PageButton(pageBackButtonX, pageButtonY, false, button -> {
this.minecraft.setScreen(new BiomeAboutScreen(this.biomeKey, this.parent));
}, true));
this.addRenderableWidget(new PageButton(pageBackButtonX, pageButtonY, false, button -> this.minecraft.setScreen(new BiomeAboutScreen(this.biomeKey, this.parent)), true));

ScrollableText mobSpawns = new ScrollableText(this.mobSpawns, this.toolTipMaxWidth, mobSpawnsTextTop, mobSpawnsTextTop, mobSpawnsTextBottom);
mobSpawns.setLeftPos(startXLeftPage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ private void createMenu(List<ResourceKey<Biome>> biomes, boolean snapToFront) {
break;
}
ResourceKey<Biome> biome = biomes.get(registryIdx);
page[yPos] = this.addWidget(new BiomeWidget(biome, xOffset + startX, yOffset, (int) (IMAGE_WIDTH / 2.5F), (int) (IMAGE_HEIGHT / 2.7), button -> {
this.minecraft.setScreen(new BiomeAboutScreen(biome, this));
}));
page[yPos] = this.addWidget(new BiomeWidget(biome, xOffset + startX, yOffset, (int) (IMAGE_WIDTH / 2.5F), (int) (IMAGE_HEIGHT / 2.7), button -> this.minecraft.setScreen(new BiomeAboutScreen(biome, this))));
registryIdx++;
yOffset += (IMAGE_HEIGHT / 2.7) + 10;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,20 +106,18 @@ protected void init() {

@NotNull
private Button.OnPress consumeLink(String url) {
return button -> {
this.minecraft.setScreen(new ConfirmLinkScreen(confirmed -> {
if (confirmed) {
try {
((ScreenAccess) this).byg_invokeOpenLink(new URI(url));
this.minecraft.setScreen(this);
} catch (URISyntaxException e) {
e.printStackTrace();
}
} else {
return button -> this.minecraft.setScreen(new ConfirmLinkScreen(confirmed -> {
if (confirmed) {
try {
((ScreenAccess) this).byg_invokeOpenLink(new URI(url));
this.minecraft.setScreen(this);
} catch (URISyntaxException e) {
e.printStackTrace();
}
}, url, false));
};
} else {
this.minecraft.setScreen(this);
}
}, url, false));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.FastColor;
import net.minecraft.world.level.biome.Biome;
import org.jetbrains.annotations.NotNull;
import potionstudios.byg.BYG;
import potionstudios.byg.util.BYGUtil;

Expand Down Expand Up @@ -47,12 +48,12 @@ public void onClick(double $$0, double $$1) {
}

@Override
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) {
protected void updateWidgetNarration(@NotNull NarrationElementOutput narrationElementOutput) {

}

@Override
public void renderWidget(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
public void renderWidget(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
if (this.visible) {
if (previewImageLocation != null) {
float scale = 0.09F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import org.jetbrains.annotations.NotNull;

public class ItemWidget extends AbstractWidget {
public final ItemStack stack;
Expand All @@ -24,7 +25,7 @@ public ItemWidget(ItemStack stack, ItemRenderer itemRenderer, int pX, int pY, in
}

@Override
protected void updateWidgetNarration(NarrationElementOutput narrationElementOutput) {
protected void updateWidgetNarration(@NotNull NarrationElementOutput narrationElementOutput) {

}

Expand All @@ -35,7 +36,7 @@ public void onClick(double $$0, double $$1) {
}

@Override
public void renderWidget(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
public void renderWidget(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
this.itemRenderer.renderAndDecorateItem(poseStack, this.stack, this.getX(), this.getY());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.network.chat.Component;
import net.minecraft.util.FastColor;
import net.minecraft.util.FormattedCharSequence;
import org.jetbrains.annotations.NotNull;
import potionstudios.byg.client.gui.screen.BYGContainerObjectSelectionList;

import java.util.List;
Expand All @@ -33,7 +34,7 @@ public ScrollableText(Component text, int width, int height, int y0, int y1, int
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
super.render(poseStack, mouseX, mouseY, partialTick);
if (DEBUG) {
GuiComponent.fill(poseStack, this.x0, this.y0, this.x1, this.y1, FastColor.ARGB32.color(50, 0, 255, 0));
Expand All @@ -53,18 +54,18 @@ public ScrollableTextEntry(FormattedCharSequence text, int textMaxWidth, int tex
}

@Override
public void render(PoseStack pPoseStack, int pIndex, int pTop, int pLeft, int rowWidth, int pHeight, int pMouseX, int pMouseY, boolean pIsMouseOver, float pPartialTick) {
public void render(@NotNull PoseStack pPoseStack, int pIndex, int pTop, int pLeft, int rowWidth, int pHeight, int pMouseX, int pMouseY, boolean pIsMouseOver, float pPartialTick) {
float textHeightOffset = (float) (pTop + pHeight - Minecraft.getInstance().font.lineHeight);
Minecraft.getInstance().font.draw(pPoseStack, this.text, (pLeft) + rowWidth - this.textMaxWidth, textHeightOffset, this.textColor);
}

@Override
public List<? extends GuiEventListener> children() {
public @NotNull List<? extends GuiEventListener> children() {
return ImmutableList.of();
}

@Override
public List<? extends NarratableEntry> narratables() {
public @NotNull List<? extends NarratableEntry> narratables() {
return ImmutableList.of();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import net.minecraft.client.gui.components.ContainerObjectSelectionList;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.narration.NarratableEntry;
import org.jetbrains.annotations.NotNull;
import potionstudios.byg.client.gui.screen.BYGContainerObjectSelectionList;

import java.util.List;
Expand All @@ -26,17 +27,17 @@ public WidgetList(List<AbstractWidget> widgets, int width, int height, int y0, i
}

@Override
public void render(PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
public void render(@NotNull PoseStack poseStack, int mouseX, int mouseY, float partialTick) {
super.render(poseStack, mouseX, mouseY, partialTick);
super.renderList(poseStack, mouseX, mouseY, partialTick);
}

@Override
protected void renderList(PoseStack $$0, int $$1, int $$2, float $$3) {
protected void renderList(@NotNull PoseStack $$0, int $$1, int $$2, float $$3) {
}

@Override
protected int addEntry(Entry $$0) {
protected int addEntry(@NotNull Entry $$0) {
return super.addEntry($$0);
}

Expand All @@ -49,19 +50,19 @@ public Entry(AbstractWidget text) {
}

@Override
public void render(PoseStack pPoseStack, int pIndex, int pTop, int pLeft, int rowWidth, int pHeight, int pMouseX, int pMouseY, boolean pIsMouseOver, float pPartialTick) {
public void render(@NotNull PoseStack pPoseStack, int pIndex, int pTop, int pLeft, int rowWidth, int pHeight, int pMouseX, int pMouseY, boolean pIsMouseOver, float pPartialTick) {
this.widget.setX(pLeft);
this.widget.setY(pTop);
this.widget.render(pPoseStack, pMouseX, pMouseY, pPartialTick);
}

@Override
public List<? extends GuiEventListener> children() {
public @NotNull List<? extends GuiEventListener> children() {
return ImmutableList.of(this.widget);
}

@Override
public List<? extends NarratableEntry> narratables() {
public @NotNull List<? extends NarratableEntry> narratables() {
return ImmutableList.of(this.widget);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.resources.ResourceLocation;
import net.minecraft.util.Mth;
import net.minecraft.world.entity.player.Inventory;
import org.jetbrains.annotations.NotNull;
import potionstudios.byg.BYG;
import potionstudios.byg.client.gui.HypogealImperiumContainer;

Expand All @@ -29,14 +30,14 @@ protected void init() {
}

@Override
public void render(PoseStack matrixStack, final int mouseX, final int mouseY, final float partialTicks) {
public void render(@NotNull PoseStack matrixStack, final int mouseX, final int mouseY, final float partialTicks) {
this.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
this.renderTooltip(matrixStack, mouseX, mouseY);
}

@Override
protected void renderBg(PoseStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) {
protected void renderBg(@NotNull PoseStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) {
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, BACKGROUND_TEXTURE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public AbstractBarrelCactusBlock(Properties $$0) {
}

@Override
public boolean isValidBonemealTarget(LevelReader levelReader, BlockPos blockPos, BlockState blockState, boolean b) {
public boolean isValidBonemealTarget(@NotNull LevelReader levelReader, @NotNull BlockPos blockPos, @NotNull BlockState blockState, boolean b) {
return true;
}

Expand Down Expand Up @@ -70,15 +70,13 @@ public void performBonemeal(ServerLevel serverLevel, @NotNull RandomSource rando
serverLevel.neighborChanged(blockPos, BYGBlocks.FLOWERING_BARREL_CACTUS.get(), blockPos);
}

public InteractionResult use(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos $$2, @NotNull Player $$3, @NotNull InteractionHand $$4, @NotNull BlockHitResult $$5) {
public @NotNull InteractionResult use(@NotNull BlockState state, @NotNull Level world, @NotNull BlockPos $$2, @NotNull Player $$3, @NotNull InteractionHand $$4, @NotNull BlockHitResult $$5) {
ItemStack $$6 = $$3.getItemInHand($$4);
if ($$6.is(BYGTags.SHEARS.all(BYGTags.RegistryType.ITEMS))) {
if (!world.isClientSide) {
world.playSound(null, $$2, SoundEvents.PUMPKIN_CARVE, SoundSource.BLOCKS, 1.0F, 1.0F);
world.setBlock($$2, BYGBlocks.CARVED_BARREL_CACTUS.defaultBlockState(), 11);
$$6.hurtAndBreak(1, $$3, ($$1x) -> {
$$1x.broadcastBreakEvent($$4);
});
$$6.hurtAndBreak(1, $$3, ($$1x) -> $$1x.broadcastBreakEvent($$4));
world.gameEvent($$3, GameEvent.SHEAR, $$2);
$$3.awardStat(Stats.ITEM_USED.get(Items.SHEARS));
}
Expand All @@ -94,11 +92,11 @@ protected boolean mayPlaceOn(@NotNull BlockState $$0, BlockGetter $$1, BlockPos
return ($$6.is(BlockTags.SAND)) && !$$1.getBlockState($$2.above()).getMaterial().isLiquid();
}

public boolean canSurvive(BlockState $$0, LevelReader $$1, @NotNull BlockPos $$2) {
public boolean canSurvive(@NotNull BlockState $$0, @NotNull LevelReader $$1, @NotNull BlockPos $$2) {
return this.mayPlaceOn($$1.getBlockState($$2.above()), $$1, $$2);
}

public BlockState updateShape(BlockState $$0, Direction $$1, BlockState $$2, LevelAccessor $$3, BlockPos $$4, BlockPos $$5) {
public @NotNull BlockState updateShape(BlockState $$0, @NotNull Direction $$1, @NotNull BlockState $$2, @NotNull LevelAccessor $$3, @NotNull BlockPos $$4, @NotNull BlockPos $$5) {
if (!$$0.canSurvive($$3, $$4)) {
return Blocks.AIR.defaultBlockState();
}
Expand All @@ -109,11 +107,11 @@ public boolean isPathfindable(@NotNull BlockState $$0, @NotNull BlockGetter $$1,
return false;
}

public VoxelShape getCollisionShape(BlockState $$0, BlockGetter $$1, BlockPos $$2, CollisionContext $$3) {
public @NotNull VoxelShape getCollisionShape(@NotNull BlockState $$0, @NotNull BlockGetter $$1, @NotNull BlockPos $$2, @NotNull CollisionContext $$3) {
return COLLISION_SHAPE;
}

public VoxelShape getShape(BlockState $$0, BlockGetter $$1, BlockPos $$2, CollisionContext $$3) {
public @NotNull VoxelShape getShape(@NotNull BlockState $$0, @NotNull BlockGetter $$1, @NotNull BlockPos $$2, @NotNull CollisionContext $$3) {
return OUTLINE_SHAPE;
}

Expand Down
Loading

0 comments on commit dffe741

Please sign in to comment.