Skip to content

Commit af3f6a7

Browse files
committed
Initial updates
1 parent f37f3d0 commit af3f6a7

File tree

201 files changed

+1829
-1940
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

201 files changed

+1829
-1940
lines changed

src/main/java/dev/compactmods/crafting/compat/jei/JeiMiniaturizationCraftingCategory.java renamed to 1.16.5-compat/jei/JeiMiniaturizationCraftingCategory.java

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import java.util.*;
55
import java.util.concurrent.atomic.AtomicInteger;
66
import java.util.stream.IntStream;
7-
import com.mojang.blaze3d.matrix.MatrixStack;
7+
import com.mojang.blaze3d.vertex.PoseStack;
88
import com.mojang.blaze3d.systems.RenderSystem;
99
import dev.compactmods.crafting.CompactCrafting;
1010
import dev.compactmods.crafting.Registration;
@@ -25,30 +25,30 @@
2525
import mezz.jei.api.helpers.IGuiHelper;
2626
import mezz.jei.api.ingredients.IIngredients;
2727
import mezz.jei.api.recipe.category.IRecipeCategory;
28-
import net.minecraft.block.BlockState;
29-
import net.minecraft.client.MainWindow;
28+
import net.minecraft.world.level.block.state.BlockState;
29+
import com.mojang.blaze3d.platform.Window;
3030
import net.minecraft.client.Minecraft;
31-
import net.minecraft.client.audio.SimpleSound;
32-
import net.minecraft.client.audio.SoundHandler;
33-
import net.minecraft.client.gui.AbstractGui;
34-
import net.minecraft.client.renderer.BlockRendererDispatcher;
35-
import net.minecraft.client.renderer.IRenderTypeBuffer;
31+
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
32+
import net.minecraft.client.sounds.SoundManager;
33+
import net.minecraft.client.gui.GuiComponent;
34+
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
35+
import net.minecraft.client.renderer.MultiBufferSource;
3636
import net.minecraft.client.renderer.texture.OverlayTexture;
37-
import net.minecraft.client.resources.I18n;
38-
import net.minecraft.item.Item;
39-
import net.minecraft.item.ItemStack;
40-
import net.minecraft.item.Items;
41-
import net.minecraft.tileentity.TileEntity;
42-
import net.minecraft.util.ResourceLocation;
43-
import net.minecraft.util.SoundEvents;
44-
import net.minecraft.util.math.AxisAlignedBB;
45-
import net.minecraft.util.math.BlockPos;
46-
import net.minecraft.util.math.vector.Matrix4f;
47-
import net.minecraft.util.math.vector.Quaternion;
48-
import net.minecraft.util.math.vector.Vector3d;
49-
import net.minecraft.util.text.IFormattableTextComponent;
50-
import net.minecraft.util.text.TextFormatting;
51-
import net.minecraft.util.text.TranslationTextComponent;
37+
import net.minecraft.client.resources.language.I18n;
38+
import net.minecraft.world.item.Item;
39+
import net.minecraft.world.item.ItemStack;
40+
import net.minecraft.world.item.Items;
41+
import net.minecraft.world.level.block.entity.BlockEntity;
42+
import net.minecraft.resources.ResourceLocation;
43+
import net.minecraft.sounds.SoundEvents;
44+
import net.minecraft.world.phys.AABB;
45+
import net.minecraft.core.BlockPos;
46+
import com.mojang.math.Matrix4f;
47+
import com.mojang.math.Quaternion;
48+
import net.minecraft.world.phys.Vec3;
49+
import net.minecraft.network.chat.MutableComponent;
50+
import net.minecraft.ChatFormatting;
51+
import net.minecraft.network.chat.TranslatableComponent;
5252
import net.minecraftforge.client.model.data.EmptyModelData;
5353
import net.minecraftforge.client.model.data.IModelData;
5454
import org.lwjgl.BufferUtils;
@@ -57,7 +57,7 @@ public class JeiMiniaturizationCraftingCategory implements IRecipeCategory<Minia
5757

5858
public static final ResourceLocation UID = new ResourceLocation(CompactCrafting.MOD_ID, "miniaturization");
5959
private final IDrawable icon;
60-
private final BlockRendererDispatcher blocks;
60+
private final BlockRenderDispatcher blocks;
6161
private RenderingWorld previewLevel;
6262

6363
private IGuiHelper guiHelper;
@@ -184,18 +184,18 @@ public void setRecipe(IRecipeLayout recipeLayout, MiniaturizationRecipe recipe,
184184
int finalCatalystSlot = catalystSlot;
185185
guiItemStacks.addTooltipCallback((slot, b, itemStack, tooltip) -> {
186186
if (slot >= 0 && slot < recipe.getComponents().size()) {
187-
IFormattableTextComponent text =
188-
new TranslationTextComponent(CompactCrafting.MOD_ID + ".jei.miniaturization.component")
189-
.withStyle(TextFormatting.GRAY)
190-
.withStyle(TextFormatting.ITALIC);
187+
MutableComponent text =
188+
new TranslatableComponent(CompactCrafting.MOD_ID + ".jei.miniaturization.component")
189+
.withStyle(ChatFormatting.GRAY)
190+
.withStyle(ChatFormatting.ITALIC);
191191

192192
tooltip.add(text);
193193
}
194194

195195
if (slot == finalCatalystSlot) {
196-
IFormattableTextComponent text = new TranslationTextComponent(CompactCrafting.MOD_ID + ".jei.miniaturization.catalyst")
197-
.withStyle(TextFormatting.YELLOW)
198-
.withStyle(TextFormatting.ITALIC);
196+
MutableComponent text = new TranslatableComponent(CompactCrafting.MOD_ID + ".jei.miniaturization.catalyst")
197+
.withStyle(ChatFormatting.YELLOW)
198+
.withStyle(ChatFormatting.ITALIC);
199199

200200
tooltip.add(text);
201201
}
@@ -262,25 +262,25 @@ private void addOutputSlots(MiniaturizationRecipe recipe, int GUTTER_X, int OFFS
262262
@Override
263263
public boolean handleClick(MiniaturizationRecipe recipe, double mouseX, double mouseY, int mouseButton) {
264264

265-
SoundHandler handler = Minecraft.getInstance().getSoundManager();
265+
SoundManager handler = Minecraft.getInstance().getSoundManager();
266266

267267

268268
if (explodeToggle.contains(mouseX, mouseY)) {
269269
explodeMulti = exploded ? 1.0d : 1.6d;
270270
exploded = !exploded;
271-
handler.play(SimpleSound.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
271+
handler.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
272272
return true;
273273
}
274274

275275
if (layerSwap.contains(mouseX, mouseY)) {
276276
singleLayer = !singleLayer;
277-
handler.play(SimpleSound.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
277+
handler.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
278278
return true;
279279
}
280280

281281
if (layerUp.contains(mouseX, mouseY) && singleLayer) {
282282
if (singleLayerOffset < recipe.getDimensions().getYsize() - 1) {
283-
handler.play(SimpleSound.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
283+
handler.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
284284
singleLayerOffset++;
285285
}
286286

@@ -289,7 +289,7 @@ public boolean handleClick(MiniaturizationRecipe recipe, double mouseX, double m
289289

290290
if (layerDown.contains(mouseX, mouseY) && singleLayer) {
291291
if (singleLayerOffset > 0) {
292-
handler.play(SimpleSound.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
292+
handler.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK, 1.0F));
293293
singleLayerOffset--;
294294
}
295295

@@ -301,7 +301,7 @@ public boolean handleClick(MiniaturizationRecipe recipe, double mouseX, double m
301301

302302
//region Rendering help
303303
private void drawScaledTexture(
304-
MatrixStack matrixStack,
304+
PoseStack matrixStack,
305305
ResourceLocation texture,
306306
ScreenArea area,
307307
float u, float v,
@@ -312,17 +312,17 @@ private void drawScaledTexture(
312312
minecraft.getTextureManager().bind(texture);
313313

314314
RenderSystem.enableDepthTest();
315-
AbstractGui.blit(matrixStack, area.x, area.y, area.width, area.height,
315+
GuiComponent.blit(matrixStack, area.x, area.y, area.width, area.height,
316316
u, v, uWidth, vHeight, textureWidth, textureHeight);
317317
}
318318

319319
//endregion
320320

321321
@Override
322-
public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, double mouseY) {
323-
AxisAlignedBB dims = recipe.getDimensions();
322+
public void draw(MiniaturizationRecipe recipe, PoseStack mx, double mouseX, double mouseY) {
323+
AABB dims = recipe.getDimensions();
324324

325-
MainWindow mainWindow = Minecraft.getInstance().getWindow();
325+
Window mainWindow = Minecraft.getInstance().getWindow();
326326

327327
drawScaledTexture(mx,
328328
new ResourceLocation(CompactCrafting.MOD_ID, "textures/gui/jei-arrow-field.png"),
@@ -349,25 +349,25 @@ public void draw(MiniaturizationRecipe recipe, MatrixStack mx, double mouseX, do
349349
if (previewLevel != null) renderRecipe(recipe, mx, dims, guiScaleFactor, scissorBounds);
350350
}
351351

352-
private void renderRecipe(MiniaturizationRecipe recipe, MatrixStack mx, AxisAlignedBB dims, double guiScaleFactor, ScreenArea scissorBounds) {
352+
private void renderRecipe(MiniaturizationRecipe recipe, PoseStack mx, AABB dims, double guiScaleFactor, ScreenArea scissorBounds) {
353353
try {
354-
AbstractGui.fill(
354+
GuiComponent.fill(
355355
mx,
356356
scissorBounds.x, scissorBounds.y,
357357
scissorBounds.x + scissorBounds.width,
358358
scissorBounds.height,
359359
0xFF404040
360360
);
361361

362-
IRenderTypeBuffer.Impl buffers = Minecraft.getInstance().renderBuffers().bufferSource();
362+
MultiBufferSource.BufferSource buffers = Minecraft.getInstance().renderBuffers().bufferSource();
363363

364364
final double scale = Minecraft.getInstance().getWindow().getGuiScale();
365365
final Matrix4f matrix = mx.last().pose();
366366
final FloatBuffer buf = BufferUtils.createFloatBuffer(16);
367367
matrix.store(buf);
368368

369369
// { x, y, z }
370-
Vector3d translation = new Vector3d(
370+
Vec3 translation = new Vec3(
371371
buf.get(12) * scale,
372372
buf.get(13) * scale,
373373
buf.get(14) * scale);
@@ -397,7 +397,7 @@ private void renderRecipe(MiniaturizationRecipe recipe, MatrixStack mx, AxisAlig
397397
// 03 = 11
398398
// 01 = 13
399399

400-
Vector3d dimsVec = new Vector3d(dims.getXsize(), dims.getYsize(), dims.getZsize());
400+
Vec3 dimsVec = new Vec3(dims.getXsize(), dims.getYsize(), dims.getZsize());
401401
float recipeAvgDim = (float) dimsVec.length();
402402
float previewScale = (float) ((3 + Math.exp(3 - (recipeAvgDim / 5))) / explodeMulti);
403403
mx.scale(previewScale, -previewScale, previewScale);
@@ -414,7 +414,7 @@ private void renderRecipe(MiniaturizationRecipe recipe, MatrixStack mx, AxisAlig
414414
}
415415
}
416416

417-
private void drawActualRecipe(MiniaturizationRecipe recipe, MatrixStack mx, AxisAlignedBB dims, IRenderTypeBuffer.Impl buffers) {
417+
private void drawActualRecipe(MiniaturizationRecipe recipe, PoseStack mx, AABB dims, MultiBufferSource.BufferSource buffers) {
418418
double gameTime = Minecraft.getInstance().level.getGameTime();
419419
double test = Math.toDegrees(gameTime) / 15;
420420
mx.mulPose(new Quaternion(35f,
@@ -446,7 +446,7 @@ private void drawActualRecipe(MiniaturizationRecipe recipe, MatrixStack mx, Axis
446446
}
447447
}
448448

449-
private void renderPreviewControls(MatrixStack mx, AxisAlignedBB dims) {
449+
private void renderPreviewControls(PoseStack mx, AABB dims) {
450450
mx.pushPose();
451451
mx.translate(0, 0, 10);
452452

@@ -477,11 +477,11 @@ private void renderPreviewControls(MatrixStack mx, AxisAlignedBB dims) {
477477
mx.popPose();
478478
}
479479

480-
private void renderRecipeLayer(MiniaturizationRecipe recipe, MatrixStack mx, IRenderTypeBuffer.Impl buffers, IRecipeLayer l, int layerY) {
480+
private void renderRecipeLayer(MiniaturizationRecipe recipe, PoseStack mx, MultiBufferSource.BufferSource buffers, IRecipeLayer l, int layerY) {
481481
// Begin layer
482482
mx.pushPose();
483483

484-
AxisAlignedBB layerBounds = BlockSpaceUtil.getLayerBounds(recipe.getDimensions(), layerY);
484+
AABB layerBounds = BlockSpaceUtil.getLayerBounds(recipe.getDimensions(), layerY);
485485
BlockPos.betweenClosedStream(layerBounds).forEach(filledPos -> {
486486
mx.pushPose();
487487

@@ -504,20 +504,20 @@ private void renderRecipeLayer(MiniaturizationRecipe recipe, MatrixStack mx, IRe
504504
mx.popPose();
505505
}
506506

507-
private void renderComponent(MatrixStack mx, IRenderTypeBuffer.Impl buffers, IRecipeBlockComponent state, BlockPos filledPos) {
507+
private void renderComponent(PoseStack mx, MultiBufferSource.BufferSource buffers, IRecipeBlockComponent state, BlockPos filledPos) {
508508
// TODO - Render switching at fixed interval
509509
if (state.didErrorRendering())
510510
return;
511511

512512
BlockState state1 = state.getRenderState();
513513
// Thanks Immersive, Astral, and others
514-
IRenderTypeBuffer light = CCRenderTypes.disableLighting(buffers);
514+
MultiBufferSource light = CCRenderTypes.disableLighting(buffers);
515515

516516
IModelData data = EmptyModelData.INSTANCE;
517517
if (previewLevel != null && state1.hasTileEntity()) {
518518
// create fake world instance
519519
// get tile entity - extend EmptyBlockReader with impl
520-
TileEntity be = previewLevel.getBlockEntity(filledPos);
520+
BlockEntity be = previewLevel.getBlockEntity(filledPos);
521521
if (be != null)
522522
data = be.getModelData();
523523
}

src/main/java/dev/compactmods/crafting/compat/jei/JeiMiniaturizationPlugin.java renamed to 1.16.5-compat/jei/JeiMiniaturizationPlugin.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
import mezz.jei.api.registration.IRecipeCategoryRegistration;
1111
import mezz.jei.api.registration.IRecipeRegistration;
1212
import net.minecraft.client.Minecraft;
13-
import net.minecraft.client.world.ClientWorld;
14-
import net.minecraft.item.ItemStack;
15-
import net.minecraft.item.crafting.RecipeManager;
16-
import net.minecraft.util.ResourceLocation;
13+
import net.minecraft.client.multiplayer.ClientLevel;
14+
import net.minecraft.world.item.ItemStack;
15+
import net.minecraft.world.item.crafting.RecipeManager;
16+
import net.minecraft.resources.ResourceLocation;
1717

1818
import java.util.List;
1919

@@ -43,7 +43,7 @@ public void registerRecipeCatalysts(IRecipeCatalystRegistration registration) {
4343

4444
@Override
4545
public void registerRecipes(IRecipeRegistration registration) {
46-
ClientWorld w = Minecraft.getInstance().level;
46+
ClientLevel w = Minecraft.getInstance().level;
4747
RecipeManager rm = w == null ? null : w.getRecipeManager();
4848
if(rm != null) {
4949
List<RecipeBase> miniRecipes = rm.getAllRecipesFor(Registration.MINIATURIZATION_RECIPE_TYPE);

src/main/java/dev/compactmods/crafting/compat/theoneprobe/TOPMain.java renamed to 1.16.5-compat/theoneprobe/TOPMain.java

File renamed without changes.

src/main/java/dev/compactmods/crafting/compat/theoneprobe/TheOneProbeCompat.java renamed to 1.16.5-compat/theoneprobe/TheOneProbeCompat.java

File renamed without changes.

src/main/java/dev/compactmods/crafting/compat/theoneprobe/providers/FieldProjectorProvider.java renamed to 1.16.5-compat/theoneprobe/providers/FieldProjectorProvider.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
import dev.compactmods.crafting.api.EnumCraftingState;
99
import dev.compactmods.crafting.api.recipe.IMiniaturizationRecipe;
1010
import mcjty.theoneprobe.api.*;
11-
import net.minecraft.block.BlockState;
12-
import net.minecraft.entity.player.PlayerEntity;
13-
import net.minecraft.item.ItemStack;
14-
import net.minecraft.util.ResourceLocation;
15-
import net.minecraft.util.text.TranslationTextComponent;
16-
import net.minecraft.world.World;
11+
import net.minecraft.world.level.block.state.BlockState;
12+
import net.minecraft.world.entity.player.Player;
13+
import net.minecraft.world.item.ItemStack;
14+
import net.minecraft.resources.ResourceLocation;
15+
import net.minecraft.network.chat.TranslatableComponent;
16+
import net.minecraft.world.level.Level;
1717

1818
public class FieldProjectorProvider implements IProbeInfoProvider {
1919
@Override
@@ -22,7 +22,7 @@ public String getID() {
2222
}
2323

2424
@Override
25-
public void addProbeInfo(ProbeMode mode, IProbeInfo info, PlayerEntity player, World level, BlockState state, IProbeHitData hitData) {
25+
public void addProbeInfo(ProbeMode mode, IProbeInfo info, Player player, Level level, BlockState state, IProbeHitData hitData) {
2626
if (!(state.getBlock() instanceof FieldProjectorBlock))
2727
return;
2828

@@ -81,12 +81,12 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo info, PlayerEntity player, W
8181

8282
if (field.getCraftingState() == EnumCraftingState.MATCHED && progress == 0) {
8383
recipeProgress
84-
.text(new TranslationTextComponent(CompactCrafting.MOD_ID + ".top.awaiting_catalyst"));
84+
.text(new TranslatableComponent(CompactCrafting.MOD_ID + ".top.awaiting_catalyst"));
8585

8686
} else {
8787
if(mode == ProbeMode.EXTENDED) {
8888
recipeProgress
89-
.text(new TranslationTextComponent(CompactCrafting.MOD_ID + ".top.progress", progress, recipe.getCraftingTime()));
89+
.text(new TranslatableComponent(CompactCrafting.MOD_ID + ".top.progress", progress, recipe.getCraftingTime()));
9090
}
9191
}
9292
}

src/main/java/dev/compactmods/crafting/compat/theoneprobe/providers/FieldProxyProvider.java renamed to 1.16.5-compat/theoneprobe/providers/FieldProxyProvider.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@
88
import mcjty.theoneprobe.api.IProbeInfo;
99
import mcjty.theoneprobe.api.IProbeInfoProvider;
1010
import mcjty.theoneprobe.api.ProbeMode;
11-
import net.minecraft.block.BlockState;
12-
import net.minecraft.entity.player.PlayerEntity;
13-
import net.minecraft.util.math.BlockPos;
14-
import net.minecraft.util.text.TranslationTextComponent;
15-
import net.minecraft.world.World;
11+
import net.minecraft.world.level.block.state.BlockState;
12+
import net.minecraft.world.entity.player.Player;
13+
import net.minecraft.core.BlockPos;
14+
import net.minecraft.network.chat.TranslatableComponent;
15+
import net.minecraft.world.level.Level;
1616

1717
public class FieldProxyProvider implements IProbeInfoProvider {
1818
@Override
@@ -21,7 +21,7 @@ public String getID() {
2121
}
2222

2323
@Override
24-
public void addProbeInfo(ProbeMode mode, IProbeInfo info, PlayerEntity player, World level, BlockState state, IProbeHitData hitData) {
24+
public void addProbeInfo(ProbeMode mode, IProbeInfo info, Player player, Level level, BlockState state, IProbeHitData hitData) {
2525
if (!(state.getBlock() instanceof FieldProxyBlock))
2626
return;
2727

@@ -33,7 +33,7 @@ public void addProbeInfo(ProbeMode mode, IProbeInfo info, PlayerEntity player, W
3333
.ifPresent(field -> {
3434
BlockPos fieldCenter = field.getCenter();
3535

36-
info.text(new TranslationTextComponent("tooltip.compactcrafting.proxy_bound", fieldCenter.toString()));
36+
info.text(new TranslatableComponent("tooltip.compactcrafting.proxy_bound", fieldCenter.toString()));
3737
});
3838
}
3939
}

src/test/java/dev/compactmods/crafting/tests/ModTests.java renamed to 1.16.5-tests/test/java/dev/compactmods/crafting/tests/ModTests.java

File renamed without changes.

src/test/java/dev/compactmods/crafting/tests/RotationsTest.java renamed to 1.16.5-tests/test/java/dev/compactmods/crafting/tests/RotationsTest.java

File renamed without changes.

src/test/java/dev/compactmods/crafting/tests/ServerEventListener.java renamed to 1.16.5-tests/test/java/dev/compactmods/crafting/tests/ServerEventListener.java

File renamed without changes.

src/test/java/dev/compactmods/crafting/tests/api/IMiniaturizationFieldTests.java renamed to 1.16.5-tests/test/java/dev/compactmods/crafting/tests/api/IMiniaturizationFieldTests.java

File renamed without changes.

0 commit comments

Comments
 (0)