[Fix] Endless recursion in Infusion Ritual (#31)
This commit is contained in:
parent
77a71cb746
commit
4664a819b3
3 changed files with 7 additions and 7 deletions
|
@ -41,8 +41,7 @@ public class InfusionPedestal extends PedestalBlock {
|
||||||
}
|
}
|
||||||
pedestal.getRitual().checkRecipe();
|
pedestal.getRitual().checkRecipe();
|
||||||
} else {
|
} else {
|
||||||
InfusionRitual ritual = new InfusionRitual(pedestal, world, pos);
|
InfusionRitual ritual = pedestal.linkRitual(pedestal, world, pos);
|
||||||
pedestal.linkRitual(ritual);
|
|
||||||
ritual.checkRecipe();
|
ritual.checkRecipe();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,6 @@ import net.minecraft.world.level.block.entity.BlockEntity;
|
||||||
import net.minecraft.world.level.block.state.BlockState;
|
import net.minecraft.world.level.block.state.BlockState;
|
||||||
|
|
||||||
public class InfusionPedestalEntity extends PedestalBlockEntity {
|
public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
|
|
||||||
private InfusionRitual linkedRitual;
|
private InfusionRitual linkedRitual;
|
||||||
|
|
||||||
public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) {
|
public InfusionPedestalEntity(BlockPos blockPos, BlockState blockState) {
|
||||||
|
@ -23,12 +22,14 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
if (hasRitual()) {
|
if (hasRitual()) {
|
||||||
linkedRitual.setLocation(world, this.getBlockPos());
|
linkedRitual.setLocation(world, this.getBlockPos());
|
||||||
} else {
|
} else {
|
||||||
linkRitual(new InfusionRitual(this, world, this.getBlockPos()));
|
linkRitual(this, world, this.getBlockPos());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void linkRitual(InfusionRitual ritual) {
|
public InfusionRitual linkRitual(InfusionPedestalEntity pedestal, Level world, BlockPos pos) {
|
||||||
linkedRitual = ritual;
|
linkedRitual = new InfusionRitual(pedestal, world, pos);
|
||||||
|
linkedRitual.configure();
|
||||||
|
return linkedRitual;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InfusionRitual getRitual() {
|
public InfusionRitual getRitual() {
|
||||||
|
@ -53,6 +54,7 @@ public class InfusionPedestalEntity extends PedestalBlockEntity {
|
||||||
if (tag.contains("ritual")) {
|
if (tag.contains("ritual")) {
|
||||||
linkedRitual = new InfusionRitual(this, level, worldPosition);
|
linkedRitual = new InfusionRitual(this, level, worldPosition);
|
||||||
linkedRitual.fromTag(tag.getCompound("ritual"));
|
linkedRitual.fromTag(tag.getCompound("ritual"));
|
||||||
|
linkedRitual.configure();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ public class InfusionRitual implements Container {
|
||||||
this.input = pedestal;
|
this.input = pedestal;
|
||||||
this.world = world;
|
this.world = world;
|
||||||
this.worldPos = pos;
|
this.worldPos = pos;
|
||||||
configure();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void configure() {
|
public void configure() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue