Skip to content

Commit

Permalink
Fixing more issues with farm generation
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian-Wuest committed Sep 15, 2021
1 parent 714fba4 commit ce897a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,10 @@ public boolean BuildStructure(StructureConfiguration configuration, ServerWorld
block.setSubBlock(subBlock);
}

boolean priorityTwoBlock = foundBlock instanceof HopperBlock;
boolean priorityTwoBlock = foundBlock instanceof HopperBlock || foundBlock instanceof LeverBlock;

boolean priorityThreeBlock = foundBlock instanceof TorchBlock
|| foundBlock instanceof AbstractSignBlock
|| foundBlock instanceof LeverBlock
|| foundBlock instanceof AbstractButtonBlock
|| foundBlock instanceof BedBlock
|| foundBlock instanceof CarpetBlock
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,13 @@ public class ModerateFarmOptions extends BaseOption{
false,
true);

public static ModerateFarmOptions MushroomFarm = new ModerateFarmOptions(
// This is for 1.17 and later
/* public static ModerateFarmOptions MushroomFarm = new ModerateFarmOptions(
"prefab.gui.starter.farm.mushroom",
"assets/prefab/structures/mushroom_farm.zip",
"textures/gui/mushroom_farm_topdown.png",
false,
false);
false);*/

protected ModerateFarmOptions(String translationString,
String assetLocation,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import net.minecraft.entity.item.HangingEntity;
import net.minecraft.entity.item.ItemFrameEntity;
import net.minecraft.entity.item.PaintingEntity;
import net.minecraft.entity.item.minecart.AbstractMinecartEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.entity.player.ServerPlayerEntity;
import net.minecraft.item.ItemStack;
Expand Down Expand Up @@ -417,6 +418,10 @@ private static void processStructureEntities() {
entity = StructureEventHandler.setItemFrameFacingAndRotation((ItemFrameEntity) entity, buildEntity, entityPos, structure);
} else if (entity instanceof PaintingEntity) {
entity = StructureEventHandler.setPaintingFacingAndRotation((PaintingEntity) entity, buildEntity, entityPos, structure);
} else if (entity instanceof AbstractMinecartEntity) {
// Minecarts need to be slightly higher to account for the rails; otherwise they will fall through the rail and the block below the rail.
buildEntity.entityYAxisOffset = buildEntity.entityYAxisOffset + .2;
entity = StructureEventHandler.setEntityFacingAndRotation(entity, buildEntity, entityPos, structure);
} else {
// All other entities
entity = StructureEventHandler.setEntityFacingAndRotation(entity, buildEntity, entityPos, structure);
Expand Down
Binary file not shown.

0 comments on commit ce897a4

Please sign in to comment.