mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-26 15:06:42 +01:00
Merge branch 'Creators-of-Create:mc1.18/dev' into mc1.18/mmc-1
This commit is contained in:
commit
5277d5971d
7 changed files with 59 additions and 22 deletions
|
@ -208,6 +208,8 @@ dependencies {
|
|||
// runtimeOnly fg.deobf("maven.modrinth:rubidium:0.5.3")
|
||||
// implementation fg.deobf("com.railwayteam.railways:railways-1.18.2-1.1.1:all") { transitive = false }
|
||||
// runtimeOnly fg.deobf("maven.modrinth:spark:1.10.38-forge")
|
||||
//runtimeOnly fg.deobf("curse.maven:forbidden-arcanus-309858:4729924")
|
||||
//runtimeOnly fg.deobf("curse.maven:valhelsia-core-416935:3886212")
|
||||
|
||||
// https://discord.com/channels/313125603924639766/725850371834118214/910619168821354497
|
||||
// Prevent Mixin annotation processor from getting into IntelliJ's annotation processor settings
|
||||
|
|
|
@ -4,8 +4,10 @@ import java.util.function.Predicate;
|
|||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.AllShapes;
|
||||
import com.simibubi.create.content.kinetics.steamEngine.PoweredShaftBlock;
|
||||
import com.simibubi.create.foundation.placement.IPlacementHelper;
|
||||
import com.simibubi.create.foundation.placement.PlacementHelpers;
|
||||
import com.simibubi.create.foundation.placement.PlacementOffset;
|
||||
import com.simibubi.create.foundation.placement.PoleHelper;
|
||||
import com.simibubi.create.foundation.utility.Iterate;
|
||||
import com.simibubi.create.foundation.utility.VoxelShaper;
|
||||
|
@ -36,6 +38,8 @@ import net.minecraft.world.phys.BlockHitResult;
|
|||
import net.minecraft.world.phys.shapes.CollisionContext;
|
||||
import net.minecraft.world.phys.shapes.VoxelShape;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public class CopycatStepBlock extends WaterloggedCopycatBlock {
|
||||
|
||||
public static final EnumProperty<Half> HALF = BlockStateProperties.HALF;
|
||||
|
@ -222,10 +226,21 @@ public class CopycatStepBlock extends WaterloggedCopycatBlock {
|
|||
}
|
||||
|
||||
@Override
|
||||
public Predicate<ItemStack> getItemPredicate() {
|
||||
public @NotNull Predicate<ItemStack> getItemPredicate() {
|
||||
return AllBlocks.COPYCAT_STEP::isIn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public @NotNull PlacementOffset getOffset(Player player, Level world, BlockState state, BlockPos pos,
|
||||
BlockHitResult ray) {
|
||||
PlacementOffset offset = super.getOffset(player, world, state, pos, ray);
|
||||
|
||||
if (offset.isSuccessful())
|
||||
offset.withTransform(offset.getTransform()
|
||||
.andThen(s -> s.setValue(HALF, state.getValue(HALF))));
|
||||
|
||||
return offset;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -128,8 +128,9 @@ public class BeltDeployerCallbacks {
|
|||
}
|
||||
|
||||
ItemStack heldItem = blockEntity.player.getMainHandItem();
|
||||
boolean unbreakable = heldItem.hasTag() && heldItem.getTag()
|
||||
.getBoolean("Unbreakable");
|
||||
boolean unbreakable = heldItem.hasTag() && (
|
||||
heldItem.getTag().getBoolean("Unbreakable") ||
|
||||
heldItem.getTag().getString("Modifier").equals("forbidden_arcanus:eternal")); // Forbidden Arcanus Compat, See Creators-of-Create#6220
|
||||
boolean keepHeld =
|
||||
recipe instanceof ItemApplicationRecipe && ((ItemApplicationRecipe) recipe).shouldKeepHeldItem();
|
||||
|
||||
|
|
|
@ -6,8 +6,10 @@ import java.util.List;
|
|||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import com.simibubi.create.foundation.data.recipe.Mods;
|
||||
import com.simibubi.create.foundation.utility.NBTProcessors;
|
||||
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.entity.Entity;
|
||||
import net.minecraft.world.entity.decoration.ArmorStand;
|
||||
import net.minecraft.world.entity.decoration.ItemFrame;
|
||||
|
@ -94,10 +96,19 @@ public class ItemRequirement {
|
|||
if (block instanceof SnowLayerBlock)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, new ItemStack(item, state.getValue(SnowLayerBlock.LAYERS)
|
||||
.intValue()));
|
||||
// FD's rich soil extends FarmBlock so this is to make sure the cost is correct (it should be rich soil not dirt)
|
||||
if (block == Registry.BLOCK.get(Mods.FD.asResource("rich_soil_farmland")))
|
||||
return new ItemRequirement(ItemUseType.CONSUME, Registry.ITEM.get(Mods.FD.asResource("rich_soil")));
|
||||
if (block instanceof FarmBlock || block instanceof DirtPathBlock)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, Items.DIRT);
|
||||
if (block instanceof AbstractBannerBlock && be instanceof BannerBlockEntity bannerBE)
|
||||
return new ItemRequirement(new StrictNbtStackRequirement(bannerBE.getItem(), ItemUseType.CONSUME));
|
||||
// Tall grass doesnt exist as a block so use 2 grass blades
|
||||
if (block == Blocks.TALL_GRASS)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, new ItemStack(Items.GRASS, 2));
|
||||
// Large ferns don't exist as blocks so use 2 ferns instead
|
||||
if (block == Blocks.LARGE_FERN)
|
||||
return new ItemRequirement(ItemUseType.CONSUME, new ItemStack(Items.FERN, 2));
|
||||
|
||||
return new ItemRequirement(ItemUseType.CONSUME, item);
|
||||
}
|
||||
|
|
|
@ -227,15 +227,21 @@ public abstract class AbstractBogeyBlock<T extends AbstractBogeyBlockEntity> ext
|
|||
sbbe.setBogeyData(sbbe.getBogeyData().merge(defaultData));
|
||||
|
||||
if (size == getSize()) {
|
||||
if (state.getBlock() != style.getBlockOfSize(size)) {
|
||||
CompoundTag oldData = sbbe.getBogeyData();
|
||||
level.setBlock(pos, copyProperties(state, getStateOfSize(sbbe, size)), Block.UPDATE_ALL);
|
||||
if (!(level.getBlockEntity(pos) instanceof AbstractBogeyBlockEntity bogeyBlockEntity))
|
||||
return InteractionResult.FAIL;
|
||||
bogeyBlockEntity.setBogeyData(oldData);
|
||||
}
|
||||
player.displayClientMessage(Lang.translateDirect("bogey.style.updated_style")
|
||||
.append(": ").append(style.displayName), true);
|
||||
} else {
|
||||
CompoundTag oldData = sbbe.getBogeyData();
|
||||
level.setBlock(pos, this.getStateOfSize(sbbe, size), 3);
|
||||
BlockEntity newBlockEntity = level.getBlockEntity(pos);
|
||||
if (!(newBlockEntity instanceof AbstractBogeyBlockEntity newBlockEntity1))
|
||||
level.setBlock(pos, this.getStateOfSize(sbbe, size), Block.UPDATE_ALL);
|
||||
if (!(level.getBlockEntity(pos) instanceof AbstractBogeyBlockEntity bogeyBlockEntity))
|
||||
return InteractionResult.FAIL;
|
||||
newBlockEntity1.setBogeyData(oldData);
|
||||
bogeyBlockEntity.setBogeyData(oldData);
|
||||
player.displayClientMessage(Lang.translateDirect("bogey.style.updated_style_and_size")
|
||||
.append(": ").append(style.displayName), true);
|
||||
}
|
||||
|
@ -312,18 +318,18 @@ public abstract class AbstractBogeyBlock<T extends AbstractBogeyBlockEntity> ext
|
|||
return target;
|
||||
}
|
||||
|
||||
public BlockState getNextSize(AbstractBogeyBlockEntity sbte) {
|
||||
public BlockState getNextSize(AbstractBogeyBlockEntity sbbe) {
|
||||
BogeySizes.BogeySize size = this.getSize();
|
||||
BogeyStyle style = sbte.getStyle();
|
||||
BogeyStyle style = sbbe.getStyle();
|
||||
BlockState nextBlock = style.getNextBlock(size).defaultBlockState();
|
||||
nextBlock = copyProperties(sbte.getBlockState(), nextBlock);
|
||||
nextBlock = copyProperties(sbbe.getBlockState(), nextBlock);
|
||||
return nextBlock;
|
||||
}
|
||||
|
||||
public BlockState getStateOfSize(AbstractBogeyBlockEntity sbte, BogeySizes.BogeySize size) {
|
||||
BogeyStyle style = sbte.getStyle();
|
||||
public BlockState getStateOfSize(AbstractBogeyBlockEntity sbbe, BogeySizes.BogeySize size) {
|
||||
BogeyStyle style = sbbe.getStyle();
|
||||
BlockState state = style.getBlockOfSize(size).defaultBlockState();
|
||||
return copyProperties(sbte.getBlockState(), state);
|
||||
return copyProperties(sbbe.getBlockState(), state);
|
||||
}
|
||||
|
||||
public BogeyStyle getNextStyle(Level level, BlockPos pos) {
|
||||
|
|
|
@ -33,6 +33,7 @@ import net.minecraft.core.Direction.AxisDirection;
|
|||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.nbt.NbtUtils;
|
||||
import net.minecraft.nbt.Tag;
|
||||
import net.minecraft.tags.BlockTags;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.player.Inventory;
|
||||
|
@ -508,8 +509,7 @@ public class TrackPlacement {
|
|||
// copy over all shared properties from the shaped state to the correct track material block
|
||||
BlockState toPlace = BlockHelper.copyProperties(state, info.trackMaterial.getBlock().defaultBlockState());
|
||||
|
||||
boolean canPlace = stateAtPos.getMaterial()
|
||||
.isReplaceable();
|
||||
boolean canPlace = stateAtPos.getMaterial().isReplaceable() || stateAtPos.is(BlockTags.FLOWERS);
|
||||
if (canPlace)
|
||||
info.requiredTracks++;
|
||||
if (simulate)
|
||||
|
|
|
@ -298,12 +298,14 @@ public class BlockHelper {
|
|||
if (data != null) {
|
||||
if (existingBlockEntity instanceof IMergeableBE mergeable) {
|
||||
BlockEntity loaded = BlockEntity.loadStatic(target, state, data);
|
||||
if (loaded != null) {
|
||||
if (existingBlockEntity.getType()
|
||||
.equals(loaded.getType())) {
|
||||
mergeable.accept(loaded);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
BlockEntity blockEntity = world.getBlockEntity(target);
|
||||
if (blockEntity != null) {
|
||||
data.putInt("x", target.getX());
|
||||
|
|
Loading…
Reference in a new issue