Skip to content

Commit

Permalink
1.4.91 on 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gnembon committed Dec 12, 2022
1 parent ebb6039 commit 7e33b8c
Show file tree
Hide file tree
Showing 16 changed files with 57 additions and 38 deletions.
14 changes: 7 additions & 7 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G

# Fabric Properties
# check these on https://fabricmc.net/develop
minecraft_version=1.19.2
yarn_mappings=1.19.2+build.28
loader_version=0.14.9
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.3
loader_version=0.14.11
# check available versions on maven (https://masa.dy.fi/maven/carpet/fabric-carpet/) for the given minecraft version you are using
carpet_core_version=1.4.84+v221018
carpet_core_version=1.4.91+v221207

# Mod Properties
mod_version = 1.4.84
mod_version = 1.4.91
maven_group = carpet-extra
archives_base_name = carpet-extra

Expand All @@ -21,12 +21,12 @@ org.gradle.jvmargs=-Xmx1G
# The Curseforge versions "names" or ids for the main branch (comma separated: 1.16.4,1.16.5)
# This is needed because CF uses too vague names for prereleases and release candidates
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
release-curse-versions = Minecraft 1.19:1.19.2
release-curse-versions = Minecraft 1.19:1.19.3
# Whether or not to build another branch on release
release-extra-branch = false
# The name of the second branch to release
release-extra-branch-name = future
# The "name" or id of the Curseforge version for the secondary branch
# This is needed because CF uses too vague names for snapshots
# Can also be the version ID directly coming from https://minecraft.curseforge.com/api/game/versions?token=[API_TOKEN]
release-extra-curse-version = Minecraft 1.19:1.19.2
release-extra-curse-version = Minecraft 1.19:1.19.3
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
import net.minecraft.item.ShearsItem;
import net.minecraft.predicate.entity.EntityPredicates;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.tag.BlockTags;
import net.minecraft.tag.ItemTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.registry.tag.ItemTags;
import net.minecraft.util.math.BlockPointer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
Expand Down Expand Up @@ -141,7 +141,7 @@ public static DispenserBehavior getCustomDispenserBehavior(ServerWorld world, Bl

// get brown mooshrooms in front of dispenser
boolean hasFeedableMooshrooms = !world.getEntitiesByType(EntityType.MOOSHROOM, frontBlockBox, EntityPredicates.VALID_LIVING_ENTITY.and((mooshroomEntity) -> {
return ((MooshroomEntity) mooshroomEntity).getMooshroomType() == MooshroomEntity.Type.BROWN;
return ((MooshroomEntity) mooshroomEntity).getVariant() == MooshroomEntity.Type.BROWN;
})).isEmpty();

// check if item is a small flower
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.List;
import java.util.Optional;

import net.minecraft.registry.tag.ItemTags;
import org.apache.commons.lang3.tuple.Pair;

import carpetextra.mixins.MooshroomEntity_StatusEffectAccessorMixin;
Expand All @@ -17,7 +18,6 @@
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvents;
import net.minecraft.tag.ItemTags;
import net.minecraft.util.math.BlockPointer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;
Expand All @@ -34,7 +34,7 @@ protected ItemStack dispenseSilently(BlockPointer pointer, ItemStack stack) {
{
// get brown mooshrooms in front of dispenser
List<MooshroomEntity> mooshrooms = world.getEntitiesByType(EntityType.MOOSHROOM, new Box(frontBlockPos), EntityPredicates.VALID_LIVING_ENTITY.and((mooshroomEntity) -> {
return ((MooshroomEntity) mooshroomEntity).getMooshroomType() == MooshroomEntity.Type.BROWN;
return ((MooshroomEntity) mooshroomEntity).getVariant() == MooshroomEntity.Type.BROWN;
}));

// check all mooshrooms
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.entity.vehicle.ChestBoatEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.tag.BlockTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.util.math.BlockPointer;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
Expand Down Expand Up @@ -40,7 +40,7 @@ public ItemStack dispenseSilently(BlockPointer pointer, ItemStack stack) {
} else {
boatEntity = new BoatEntity(world, boatXPos, boatYPos, boatZPos);
}
boatEntity.setBoatType(boatInfo.getType());
boatEntity.setVariant(boatInfo.getType());
boatEntity.setYaw(dispenserFacing.asRotation());
world.spawnEntity(boatEntity);
stack.decrement(1);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,47 @@

import carpetextra.CarpetExtraSettings;
import carpetextra.utils.WoodDelayMultipliers;
import net.minecraft.block.AbstractButtonBlock;
import net.minecraft.block.Block;
import net.minecraft.block.BlockState;
import net.minecraft.block.ButtonBlock;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(AbstractButtonBlock.class)
@Mixin(ButtonBlock.class)
public abstract class AbstractButtonBlock_variableWoodMixin
{
@Shadow protected abstract int getPressTicks();

@Redirect(method = "powerOn", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/block/AbstractButtonBlock;getPressTicks()I" // getTickRate
target = "Lnet/minecraft/world/World;scheduleBlockTick(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;I)V"
))
private int getCustomTickRate(AbstractButtonBlock abstractButtonBlock,
BlockState blockState_1, World world_1, BlockPos blockPos_1)
private void getCustomTickRate(World instance, BlockPos blockPos, Block block, int i,
BlockState state, World world, BlockPos pos)
{
if (!CarpetExtraSettings.variableWoodDelays)
{
return getPressTicks();
instance.scheduleBlockTick(blockPos, block, i);
return;
}
return WoodDelayMultipliers.getForDelay(blockState_1.getBlock(), getPressTicks());
instance.scheduleBlockTick(blockPos, block, WoodDelayMultipliers.getForDelay(state.getBlock(), i));
}

@Redirect(method = "tryPowerWithProjectiles", at = @At(
value = "INVOKE",
target = "Lnet/minecraft/world/World;scheduleBlockTick(Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/Block;I)V"
))
private void getCustomTickRateProjectiles(World instance, BlockPos blockPos, Block block, int i,
BlockState state, World world, BlockPos pos)
{
if (!CarpetExtraSettings.variableWoodDelays)
{
instance.scheduleBlockTick(blockPos, block, i);
return;
}
instance.scheduleBlockTick(blockPos, block, WoodDelayMultipliers.getForDelay(state.getBlock(), i));
}


}
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,14 @@
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(CactusBlock.class)
public abstract class CactusBlock_fertilizerMixin implements Fertilizable
{
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient)
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient)
{
int i = this.countCactusAbove(world, pos);
int j = this.countCactusBelow(world, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private void tryCraft(ServerWorld world, BlockPos pos, CallbackInfo ci)
if (!itemStack_3.isEmpty()) {
if (itemStack_2.isEmpty()) {
dispenserBlockEntity_1.setStack(int_1, itemStack_3);
} else if (ItemStack.areItemsEqualIgnoreDamage(itemStack_2, itemStack_3) && ItemStack.areNbtEqual(itemStack_2, itemStack_3)) {
} else if (itemStack_2.isItemEqual(itemStack_3) && ItemStack.areNbtEqual(itemStack_2, itemStack_3)) {
itemStack_3.increment(itemStack_2.getCount());
dispenserBlockEntity_1.setStack(int_1, itemStack_3);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityType;
import net.minecraft.entity.FallingBlockEntity;
import net.minecraft.tag.BlockTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import net.minecraft.entity.ai.brain.MemoryModuleState;
import net.minecraft.entity.ai.brain.MemoryModuleType;
import net.minecraft.entity.ai.brain.task.FarmerVillagerTask;
import net.minecraft.entity.ai.brain.task.Task;
import net.minecraft.entity.ai.brain.task.MultiTickTask;
import net.minecraft.entity.passive.VillagerEntity;
import net.minecraft.inventory.SimpleInventory;
import net.minecraft.item.ItemStack;
Expand All @@ -30,7 +30,7 @@
import java.util.Map;

@Mixin(FarmerVillagerTask.class)
public abstract class FarmerVillagerTask_wartFarmMixin extends Task<VillagerEntity>
public abstract class FarmerVillagerTask_wartFarmMixin extends MultiTickTask<VillagerEntity>
{
//@Shadow private boolean ableToPlant;
@Shadow /*@Nullable*/ private BlockPos currentTarget;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import net.minecraft.inventory.Inventory;
import net.minecraft.inventory.SidedInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tag.BlockTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.MathHelper;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

Expand All @@ -18,7 +19,7 @@ public abstract class LilyPadBlock_fertilizerMixin implements Fertilizable {
@Shadow protected abstract boolean canPlantOnTop(BlockState floor, BlockView world, BlockPos pos);

@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient) {
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient) {
return CarpetExtraSettings.betterBonemeal;
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpetextra/mixins/LivingEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import net.minecraft.entity.mob.SpiderEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.item.Items;
import net.minecraft.tag.BlockTags;
import net.minecraft.registry.tag.BlockTags;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/carpetextra/mixins/StrayEntityMixin.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

import carpetextra.CarpetExtraSettings;
import net.minecraft.entity.mob.StrayEntity;
import net.minecraft.registry.RegistryKeys;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.ServerWorldAccess;
import net.minecraft.world.gen.structure.Structure;
import net.minecraft.world.gen.structure.StructureKeys;
Expand All @@ -22,7 +22,7 @@ private static boolean isSkylightOrIglooVisible(ServerWorldAccess serverWorldAcc
if (!CarpetExtraSettings.straySpawningInIgloos) {
return serverWorldAccess.isSkyVisible(pos);
}
Structure structure = serverWorldAccess.getRegistryManager().get(Registry.STRUCTURE_KEY).get(StructureKeys.IGLOO);
Structure structure = serverWorldAccess.getRegistryManager().get(RegistryKeys.STRUCTURE).get(StructureKeys.IGLOO);
return serverWorldAccess.isSkyVisible(pos) ||
((ServerWorld)serverWorldAccess).getStructureAccessor().getStructureAt(pos,structure).hasChildren();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@
import net.minecraft.util.math.random.Random;
import net.minecraft.world.BlockView;
import net.minecraft.world.World;
import net.minecraft.world.WorldView;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(SugarCaneBlock.class)
public abstract class SugarCaneBlock_fertilizerMixin implements Fertilizable
{
@Override
public boolean isFertilizable(BlockView world, BlockPos pos, BlockState state, boolean isClient)
public boolean isFertilizable(WorldView world, BlockPos pos, BlockState state, boolean isClient)
{
int i = this.countSugarCaneAbove(world, pos);
int j = this.countSugarCaneBelow(world, pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import net.minecraft.block.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.registry.RegistryKey;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.registry.RegistryKey;
import net.minecraft.village.VillagerProfession;
import net.minecraft.world.poi.PointOfInterestType;
import org.spongepowered.asm.mixin.Mixin;
Expand All @@ -20,7 +20,7 @@ public abstract class VillagerProfession_wartFarmMixin
{
@Shadow static VillagerProfession register(String string, RegistryKey<PointOfInterestType> pointOfInterestType, ImmutableSet<Item> immutableSet, ImmutableSet<Block> immutableSet2, /*@Nullable*/ SoundEvent soundEvent) {return null;};

@Inject(method = "Lnet/minecraft/village/VillagerProfession;register(Ljava/lang/String;Lnet/minecraft/util/registry/RegistryKey;Lnet/minecraft/sound/SoundEvent;)Lnet/minecraft/village/VillagerProfession;", cancellable = true, at = @At("HEAD"))
@Inject(method = "register(Ljava/lang/String;Lnet/minecraft/registry/RegistryKey;Lnet/minecraft/sound/SoundEvent;)Lnet/minecraft/village/VillagerProfession;", cancellable = true, at = @At("HEAD"))
private static void registerCleric(String key, RegistryKey<PointOfInterestType> pointOfInterestType, SoundEvent soundEvent, CallbackInfoReturnable<VillagerProfession> cir)
{
if (key.equals("cleric"))
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/carpetextra/utils/VoidContainer.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public class VoidContainer extends ScreenHandler
public void onContentChanged(Inventory inventory_1) { }

@Override
public ItemStack transferSlot(PlayerEntity player, int index) {
public ItemStack quickMove(PlayerEntity player, int index) {
throw new IllegalStateException("Didn't expect transferSlot to be called in fake container");
}
}

0 comments on commit 7e33b8c

Please sign in to comment.