1.20.1 first trials

This commit is contained in:
Jottyfan 2023-06-21 23:40:20 +02:00
parent 62da9e3afb
commit a851302f94
8 changed files with 33 additions and 40 deletions

View File

@ -4,17 +4,17 @@
# Fabric Properties
# check these on https://fabricmc.net/versions.html
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.1
loader_version=0.14.17
minecraft_version=1.20.1
yarn_mappings=1.20.1+build.5
loader_version=0.14.21
# Mod Properties
mod_version = 1.19.4.0
mod_version = 1.20.1.0
maven_group = de.jottyfan.minecraft
archives_base_name = quickiefabric
# Dependencies
fabric_version=0.76.0+1.19.4
fabric_version=0.84.0+1.20.1
# for ExtendedLeavesBlock
terraform_wood_api_version=5.0.0-beta.1
terraform_wood_api_version=7.0.1

View File

@ -11,7 +11,6 @@ import net.minecraft.block.CropBlock;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemConvertible;
import net.minecraft.item.ItemStack;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Hand;
import net.minecraft.util.ItemScatterer;
@ -19,6 +18,7 @@ import net.minecraft.util.collection.DefaultedList;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
public class BlockCottonplant extends CropBlock {

View File

@ -12,17 +12,18 @@ import net.minecraft.block.GravelBlock;
import net.minecraft.block.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.loot.context.LootContext.Builder;
import net.minecraft.item.ToolMaterial;
import net.minecraft.loot.context.LootContextParameterSet.Builder;
/**
*
*
* @author jotty
*
*/
public class BlockDirtSalpeter extends GravelBlock {
public BlockDirtSalpeter() {
super(FabricBlockSettings.of(Material.STONE).hardness(3.1f));
super(FabricBlockSettings.copyOf(Material.STONE).hardness(3.1f));
}
@Override

View File

@ -6,9 +6,9 @@ import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import de.jottyfan.minecraft.quickiefabric.items.ItemBackpack;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@ -36,36 +36,31 @@ public class BackpackScreen extends HandledScreen<BackpackScreenHandler>
this.titleX = (this.width - this.containerWidth) / 2;
}
private void drawSlots(MatrixStack matrices, int guiX, int guiY) {
private void drawSlots(DrawContext context, int guiX, int guiY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, SLOT_TEXTURE);
for (int y = 0; y < (ItemBackpack.SLOTSIZE / 9); y++) {
for (int x = 0; x < 9; x++) {
this.drawTexture(matrices, guiX + 7 + (x * 18), guiY + 17 + (y * 18), 0, 0, 18, 18);
this.drawSlots(context, guiX, guiY);
}
}
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrices);
super.render(matrices, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(matrices, mouseX, mouseY);
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(drawContext);
super.render(drawContext, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(drawContext, mouseX, mouseY);
}
@Override
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
protected void drawBackground(DrawContext context, float delta, int mouseX, int mouseY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, TEXTURE);
int guiX = this.titleX;
int guiY = (this.height - this.containerHeight) / 2;
this.drawTexture(matrices, guiX, guiY, 0, 0, this.containerWidth, this.containerHeight);
super.renderBackground(context);
drawSlots(matrices, guiX, guiY);
}
@Override
protected void drawForeground(MatrixStack matrixStack, int i, int j) {
this.textRenderer.draw(matrixStack, this.title, 8.0F, -20.0F, 0xffcccccc); // αrgb
drawSlots(context, guiX, guiY);
}
}

View File

@ -100,8 +100,8 @@ public class BackpackScreenHandler extends ScreenHandler {
super.onSlotClick(slotId, quickCraftData, actionType, playerEntity);
}
} else {
if (playerEntity.world.isClient) {
playerEntity.world.playSound(null, BlockPos.ofFloored(playerEntity.getPos()), SoundEvents.ENTITY_VILLAGER_NO,
if (playerEntity.getEntityWorld().isClient) {
playerEntity.getEntityWorld().playSound(null, BlockPos.ofFloored(playerEntity.getPos()), SoundEvents.ENTITY_VILLAGER_NO,
SoundCategory.PLAYERS, 1f, 1f);
}
}

View File

@ -5,10 +5,9 @@ import com.mojang.blaze3d.systems.RenderSystem;
import de.jottyfan.minecraft.quickiefabric.init.RegistryManager;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.gui.DrawContext;
import net.minecraft.client.gui.screen.ingame.HandledScreen;
import net.minecraft.client.gui.screen.ingame.ScreenHandlerProvider;
import net.minecraft.client.render.GameRenderer;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.text.Text;
import net.minecraft.util.Identifier;
@ -34,18 +33,16 @@ public class BlockStackerScreen extends HandledScreen<BlockStackerScreenHandler>
}
@Override
public void render(MatrixStack matrices, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(matrices);
super.render(matrices, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(matrices, mouseX, mouseY);
public void render(DrawContext drawContext, int mouseX, int mouseY, float partialTicks) {
this.renderBackground(drawContext);
super.render(drawContext, mouseX, mouseY, partialTicks);
this.drawMouseoverTooltip(drawContext, mouseX, mouseY);
}
@Override
protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) {
protected void drawBackground(DrawContext drawContext, float delta, int mouseX, int mouseY) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
RenderSystem.setShaderTexture(0, TEXTURE);
int x = (width - backgroundWidth) / 2;
int y = (height - backgroundHeight) / 2;
drawTexture(matrices, x, y, 0, 0, backgroundWidth, backgroundHeight);
super.renderBackground(drawContext);
}
}

View File

@ -66,7 +66,7 @@ public class RegistryManager {
public static final ScreenHandlerType<BlockStackerScreenHandler> BLOCKSTACKER_SCREEN_HANDLER = ScreenHandlerRegistry
.registerSimple(RegistryManager.STACKER_IDENTIFIER, BlockStackerScreenHandler::new);
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroup.builder(new Identifier(QUICKIEFABRIC, "all"))
public static final ItemGroup QUICKIEFABRIC_GROUP = FabricItemGroup.builder()
.displayName(Text.literal(QUICKIEFABRIC))
.icon(() -> new ItemStack(QuickieItems.SPEEDPOWDER))
.entries((enabledFeatures, stacks) -> {

View File

@ -26,9 +26,9 @@
"quickiefabric.mixins.json"
],
"depends": {
"fabricloader": ">=0.14.17",
"fabricloader": ">=0.14.21",
"fabric": "*",
"minecraft": "1.19.4",
"minecraft": "1.20.1",
"java": ">=17"
},
"suggests": {