From 92f6f47058559bf106c4e24474cccf9ef6f7d9e6 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 9 Jul 2021 11:12:13 +0300 Subject: [PATCH 1/3] Infusion REI recipe fix --- gradle.properties | 2 +- .../integration/rei/REIInfusionCategory.java | 25 ++++++++++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/gradle.properties b/gradle.properties index 9e25e84c..a5a63da9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -8,7 +8,7 @@ yarn_mappings= 6 loader_version= 0.11.6 # Mod Properties -mod_version = 0.10.0-pre +mod_version = 0.10.1-pre maven_group = ru.betterend archives_base_name = better-end diff --git a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java index f974e304..a390f2c3 100644 --- a/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java +++ b/src/main/java/ru/betterend/integration/rei/REIInfusionCategory.java @@ -18,6 +18,7 @@ import org.jetbrains.annotations.NotNull; import ru.betterend.BetterEnd; import ru.betterend.registry.EndBlocks; +import java.util.ArrayList; import java.util.List; public class REIInfusionCategory implements TransferDisplayCategory { @@ -44,7 +45,6 @@ public class REIInfusionCategory implements TransferDisplayCategory setupDisplay(REIInfusionDisplay display, Rectangle bounds) { Point centerPoint = new Point(bounds.getCenterX() - 34, bounds.getCenterY() - 2); @@ -52,6 +52,14 @@ public class REIInfusionCategory implements TransferDisplayCategory inputEntries = display.getInputEntries(); List outputEntries = display.getOutputEntries(); + if (inputEntries.size() < 9) { + List newList = new ArrayList(9); + newList.addAll(inputEntries); + for (int i = inputEntries.size(); i < 9; i++) { + newList.add(EntryIngredient.empty()); + } + inputEntries = newList; + } widgets.add(Widgets.createTexturedWidget(BACKGROUND, bounds.x, bounds.y, 0, 0, 150, 104, 150, 104)); widgets.add(Widgets.createSlot(centerPoint).entries(inputEntries.get(0)).disableBackground().markInput()); widgets.add(Widgets.createSlot(new Point(centerPoint.x, centerPoint.y - 28)).entries(inputEntries.get(1)).disableBackground().markInput()); @@ -63,8 +71,15 @@ public class REIInfusionCategory implements TransferDisplayCategory widgets, Rectangle bounds, REIInfusionDisplay display, IntList redSlots) { - - } + public void renderRedSlots(PoseStack matrices, List widgets, Rectangle bounds, REIInfusionDisplay display, IntList redSlots) {} } From 2ea71cf8d6f390948d6cc15dd7923f9b55095ac9 Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 9 Jul 2021 11:32:35 +0300 Subject: [PATCH 2/3] Infusion ritual fix --- .../ru/betterend/blocks/CavePumpkinBlock.java | 2 +- .../ru/betterend/blocks/InfusionPedestal.java | 10 +++++++ .../entities/InfusionPedestalEntity.java | 27 ++++++++----------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java index 6b1feb7e..166c13e8 100644 --- a/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java +++ b/src/main/java/ru/betterend/blocks/CavePumpkinBlock.java @@ -58,7 +58,7 @@ public class CavePumpkinBlock extends BaseBlockNotFull implements IRenderTyped { VoxelShape top = Block.box(5, 15, 5, 11, 16, 11); SHAPE_BIG = Shapes.or(lantern, cap, top); - lantern = Block.box(1, 7, 1, 15, 13, 15); + lantern = Block.box(5, 7, 5, 11, 13, 11); cap = Block.box(4, 12, 4, 12, 15, 12); top = Block.box(6, 15, 6, 10, 16, 10); SHAPE_SMALL = Shapes.or(lantern, cap, top); diff --git a/src/main/java/ru/betterend/blocks/InfusionPedestal.java b/src/main/java/ru/betterend/blocks/InfusionPedestal.java index d1401a17..45c2e56e 100644 --- a/src/main/java/ru/betterend/blocks/InfusionPedestal.java +++ b/src/main/java/ru/betterend/blocks/InfusionPedestal.java @@ -6,12 +6,16 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.BlockEntityTicker; +import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.Shapes; import net.minecraft.world.phys.shapes.VoxelShape; +import org.jetbrains.annotations.Nullable; import ru.betterend.blocks.basis.PedestalBlock; import ru.betterend.blocks.entities.InfusionPedestalEntity; +import ru.betterend.blocks.entities.PedestalBlockEntity; import ru.betterend.rituals.InfusionRitual; @SuppressWarnings("deprecation") @@ -73,6 +77,12 @@ public class InfusionPedestal extends PedestalBlock { return super.getShape(state, world, pos, context); } + @Override + @Nullable + public BlockEntityTicker getTicker(Level level, BlockState blockState, BlockEntityType blockEntityType) { + return InfusionPedestalEntity::tickEnity; + } + static { VoxelShape basinUp = Block.box(2, 3, 2, 14, 4, 14); VoxelShape basinDown = Block.box(0, 0, 0, 16, 3, 16); diff --git a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java index 1136d154..b4f67dce 100644 --- a/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java +++ b/src/main/java/ru/betterend/blocks/entities/InfusionPedestalEntity.java @@ -3,6 +3,7 @@ package ru.betterend.blocks.entities; import net.minecraft.core.BlockPos; import net.minecraft.nbt.CompoundTag; import net.minecraft.world.level.Level; +import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.state.BlockState; import ru.betterend.registry.EndBlockEntities; import ru.betterend.rituals.InfusionRitual; @@ -26,15 +27,6 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { } } - public void setLevelAndPosition(Level world, BlockPos pos) { - if (hasRitual()) { - linkedRitual.setLocation(world, pos); - } - else { - linkRitual(new InfusionRitual(this, world, pos)); - } - } - public void linkRitual(InfusionRitual ritual) { linkedRitual = ritual; } @@ -47,13 +39,6 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { return linkedRitual != null; } - public static void tick(Level tickLevel, BlockPos tickPos, BlockState tickState, InfusionPedestalEntity blockEntity) { - if (blockEntity.hasRitual()) { - blockEntity.linkedRitual.tick(); - } - PedestalBlockEntity.tick(tickLevel, tickPos, tickState, blockEntity); - } - @Override public CompoundTag save(CompoundTag tag) { if (hasRitual()) { @@ -70,4 +55,14 @@ public class InfusionPedestalEntity extends PedestalBlockEntity { linkedRitual.fromTag(tag.getCompound("ritual")); } } + + public static void tickEnity(Level level, BlockPos blockPos, BlockState blockState, T uncastedEntity) { + if (uncastedEntity instanceof InfusionPedestalEntity) { + InfusionPedestalEntity blockEntity = (InfusionPedestalEntity) uncastedEntity; + if (blockEntity.hasRitual()) { + blockEntity.linkedRitual.tick(); + } + PedestalBlockEntity.tick(level, blockPos, blockState, blockEntity); + } + } } From b5f3a4f51105223e885015b521db14c0e28775ee Mon Sep 17 00:00:00 2001 From: paulevsGitch Date: Fri, 9 Jul 2021 11:39:46 +0300 Subject: [PATCH 3/3] Dragon respawn changes --- .../java/ru/betterend/mixin/common/EndDragonFightMixin.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java index 64b9d598..0ac42423 100644 --- a/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java +++ b/src/main/java/ru/betterend/mixin/common/EndDragonFightMixin.java @@ -72,7 +72,7 @@ public class EndDragonFightMixin { BlockPos center = GeneratorOptions.getPortalPos().above(5); for (Direction dir : BlocksHelper.HORIZONTAL) { BlockPos central = center.relative(dir, 4); - List crystalList = level.getEntitiesOfClass(EndCrystal.class, new AABB(central.below(10).south().west(), central.above(10).north().east())); + List crystalList = level.getEntitiesOfClass(EndCrystal.class, new AABB(central.below(255).south().west(), central.above(255).north().east())); int count = crystalList.size(); for (int n = 0; n < count; n++) {