26.3-snap-2
This commit is contained in:
1 parent
9241a6a127
commit
73fc5f1d13
20 files changed
+73
-130
No files matched your search
@@ -1,26 +0,0 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.fakes.CoralFeatureInterface;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
|
||||
import java.util.Random;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraft.world.level.LevelAccessor;
|
||||
import net.minecraft.world.level.block.state.BlockState;
|
||||
import net.minecraft.world.level.levelgen.feature.CoralFeature;
|
||||
|
||||
@Mixin(CoralFeature.class)
|
||||
public abstract class CoralFeature_renewableCoralMixin implements CoralFeatureInterface
|
||||
{
|
||||
|
||||
@Shadow protected abstract boolean placeFeature(LevelAccessor var1, RandomSource var2, BlockPos var3, BlockState var4);
|
||||
|
||||
@Override
|
||||
public boolean growSpecific(Level worldIn, RandomSource random, BlockPos pos, BlockState blockUnder)
|
||||
{
|
||||
return placeFeature(worldIn, random, pos, blockUnder);
|
||||
}
|
||||
}
|
||||
@@ -19,7 +19,7 @@ public class FlowingFluid_liquidDamageDisabledMixin
|
||||
method = "canHoldAnyFluid",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/block/state/BlockState;blocksMotion()Z"
|
||||
target = "Lnet/minecraft/world/level/block/state/BlockState;is(Lnet/minecraft/tags/TagKey;)Z"
|
||||
),
|
||||
cancellable = true
|
||||
)
|
||||
@@ -27,7 +27,7 @@ public class FlowingFluid_liquidDamageDisabledMixin
|
||||
{
|
||||
if (CarpetSettings.liquidDamageDisabled)
|
||||
{
|
||||
cir.setReturnValue(state.isAir() || state.is(Blocks.WATER) || state.is(Blocks.LAVA));
|
||||
cir.setReturnValue((state.isAir() || state.is(Blocks.WATER) || state.is(Blocks.LAVA)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,23 +2,32 @@ package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import net.minecraft.util.RandomSource;
|
||||
import net.minecraft.world.level.levelgen.feature.HugeFungusConfiguration;
|
||||
import net.minecraft.world.level.levelgen.feature.HugeFungusFeature;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyArgs;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import org.spongepowered.asm.mixin.injection.invoke.arg.Args;
|
||||
|
||||
import static carpet.CarpetSettings.FungusGrowthMode.*;
|
||||
|
||||
@Mixin(HugeFungusFeature.class)
|
||||
public class HugeFungusFeatureMixin {
|
||||
@ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
|
||||
@Inject( method = "planted", at = @At("HEAD"), cancellable = true)
|
||||
private void planted(CallbackInfoReturnable<Boolean> cir) {
|
||||
if (CarpetSettings.thickFungusGrowth == ALL) {
|
||||
cir.setReturnValue(true);
|
||||
}
|
||||
}
|
||||
|
||||
/*@ModifyArgs(method = "place", at = @At(value = "INVOKE", target = "Lnet/minecraft/world/level/levelgen/feature/HugeFungusFeature;placeStem(Lnet/minecraft/world/level/WorldGenLevel;Lnet/minecraft/util/RandomSource;Lnet/minecraft/world/level/levelgen/feature/HugeFungusConfiguration;Lnet/minecraft/core/BlockPos;IZ)V"))
|
||||
private void mixin(Args args) {
|
||||
boolean natural = !((HugeFungusConfiguration) args.get(2)).planted;
|
||||
args.set(5, natural && ((boolean) args.get(5)) ||
|
||||
!natural && (CarpetSettings.thickFungusGrowth == ALL ||
|
||||
CarpetSettings.thickFungusGrowth == RANDOM && ((RandomSource) args.get(1)).nextFloat() < 0.06F)
|
||||
);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public interface ItemStack_stackableShulkerBoxesMixin
|
||||
&& ((ItemInstance)((Object)this)) instanceof final ItemStack itemStack
|
||||
&& itemStack.getItem() instanceof BlockItem blockItem
|
||||
&& blockItem.getBlock() instanceof ShulkerBoxBlock
|
||||
&& ((ItemStack) ((Object) this)).getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).allItemsCopyStream().findAny().isEmpty()
|
||||
&& ((ItemStack) ((Object) this)).getOrDefault(DataComponents.CONTAINER, ItemContainerContents.EMPTY).itemCopies().findAny().isEmpty()
|
||||
) {
|
||||
cir.setReturnValue(CarpetSettings.shulkerBoxStackSize);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,8 @@ public class LevelRenderer_scarpetRenderMixin
|
||||
|
||||
@Inject(method = "render", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/util/profiling/ProfilerFiller;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
|
||||
target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;F)V",
|
||||
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lnet/minecraft/client/renderer/feature/FeatureRenderDispatcher$PreparedFrame;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
|
||||
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addAlwaysOnTopPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;)V",
|
||||
//target = "Lnet/minecraft/client/renderer/LevelRenderer;submitFeatures(Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/client/renderer/SubmitNodeCollector;Z)V",
|
||||
//target = "Lnet/minecraft/client/renderer/LevelRenderer;addMainPass(Lcom/mojang/blaze3d/framegraph/FrameGraphBuilder;Lcom/mojang/blaze3d/buffers/GpuBufferSlice;Lnet/minecraft/client/renderer/state/level/LevelRenderState;Lnet/minecraft/util/profiling/ProfilerFiller;Lnet/minecraft/client/renderer/chunk/ChunkSectionsToRender;)V",
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
package carpet.mixins;
|
||||
|
||||
import carpet.CarpetSettings;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
import java.util.function.Predicate;
|
||||
import net.minecraft.world.level.levelgen.structure.pieces.PieceGeneratorSupplier;
|
||||
|
||||
@Mixin(PieceGeneratorSupplier.class)
|
||||
public interface PieceGeneratorSupplier_plopMixin
|
||||
{
|
||||
@Redirect(method = "lambda$simple$0", at = @At(
|
||||
value = "INVOKE",
|
||||
target = "java/util/function/Predicate.test(Ljava/lang/Object;)Z"
|
||||
), remap = false)
|
||||
private static boolean checkMate(Predicate<Object> predicate, Object o)
|
||||
{
|
||||
return CarpetSettings.skipGenerationChecks.get() || predicate.test(o);
|
||||
}
|
||||
}
|
||||
@@ -106,14 +106,14 @@ public abstract class PistonMovingBlockEntity_movableBEMixin extends BlockEntity
|
||||
}
|
||||
|
||||
@Redirect(method = "finalTick", at = @At(value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/level/Level;setBlock(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;I)Z"))
|
||||
private boolean movableTEsetBlockState1(Level world, BlockPos blockPos_1, BlockState blockState_2, int int_1)
|
||||
target = "Lnet/minecraft/world/level/Level;setBlockAndUpdate(Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;)Z"))
|
||||
private boolean movableTESetBlockState1(Level world, BlockPos blockPos_1, BlockState blockState_2)
|
||||
{
|
||||
if (!CarpetSettings.movableBlockEntities)
|
||||
return world.setBlock(blockPos_1, blockState_2, int_1);
|
||||
return world.setBlockAndUpdate(blockPos_1, blockState_2);
|
||||
else
|
||||
{
|
||||
boolean ret = ((LevelInterface) (world)).setBlockStateWithBlockEntity(blockPos_1, blockState_2, this.carriedBlockEntity, int_1);
|
||||
boolean ret = ((LevelInterface) (world)).setBlockStateWithBlockEntity(blockPos_1, blockState_2, this.carriedBlockEntity, Block.UPDATE_ALL);
|
||||
this.carriedBlockEntity = null; //this will cancel the finishHandleBroken
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ public abstract class Player_fakePlayersMixin
|
||||
method = "causeExtraKnockback",
|
||||
at = @At(
|
||||
value = "FIELD",
|
||||
target = "Lnet/minecraft/world/entity/Entity;hurtMarked:Z",
|
||||
target = "Lnet/minecraft/world/entity/Entity;syncVelocity:Z",
|
||||
ordinal = 0
|
||||
)
|
||||
)
|
||||
private boolean velocityModifiedAndNotCarpetFakePlayer(Entity target)
|
||||
{
|
||||
return target.hurtMarked && !(target instanceof EntityPlayerMPFake);
|
||||
return target.syncVelocity && !(target instanceof EntityPlayerMPFake);
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,7 @@ import carpet.helpers.ParticleDisplay;
|
||||
import carpet.utils.Messenger;
|
||||
import carpet.utils.MobAI;
|
||||
import net.minecraft.core.particles.DustParticleOptions;
|
||||
import net.minecraft.tags.ItemTags;
|
||||
import net.minecraft.world.entity.ai.village.poi.PoiTypes;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Shadow;
|
||||
@@ -33,7 +34,6 @@ import net.minecraft.world.entity.npc.villager.AbstractVillager;
|
||||
import net.minecraft.world.entity.npc.villager.Villager;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.entity.schedule.Activity;
|
||||
import net.minecraft.world.item.BedItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
import net.minecraft.world.level.Level;
|
||||
@@ -140,7 +140,7 @@ public abstract class Villager_aiMixin extends AbstractVillager
|
||||
while(countFoodPointsInInventory() >= 12) eatAndDigestFood();
|
||||
|
||||
}
|
||||
else if (itemStack_1.getItem() instanceof BedItem)
|
||||
else if (itemStack_1.is(ItemTags.BEDS))
|
||||
{
|
||||
List<PoiRecord> list_1 = ((ServerLevel) level()).getPoiManager().getInRange(
|
||||
type -> type.is(PoiTypes.HOME),
|
||||
|
||||
Reference in new issue
Block a user