Skip to content

Commit

Permalink
Update to v1.19.4
Browse files Browse the repository at this point in the history
  • Loading branch information
FxMorin committed Jun 14, 2023
1 parent c603b75 commit 399e4d1
Show file tree
Hide file tree
Showing 29 changed files with 97 additions and 356 deletions.
2 changes: 0 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ dependencies {
include "com.github.LlamaLad7:MixinExtras:${project.mixinextras_version}"
implementation("com.github.LlamaLad7:MixinExtras:${project.mixinextras_version}")
annotationProcessor("com.github.LlamaLad7:MixinExtras:${project.mixinextras_version}")

modRuntimeOnly "com.github.astei:lazydfu:0.1.2"
}

processResources {
Expand Down
24 changes: 12 additions & 12 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ org.gradle.jvmargs=-Xmx2G

# Fabric Properties
# check these on https://fabricmc.net/use or https://modmuss50.me/fabric.html
display_minecraft_version=1.19.3
minecraft_version=1.19.3
yarn_mappings=1.19.3+build.2
display_minecraft_version=1.19.4
minecraft_version=1.19.4
yarn_mappings=1.19.4+build.2
loader_version=0.14.3
carpet_minecraft_version=1.19.3
carpet_minecraft_version=1.19.4
# check available versions on maven for the given minecraft version you are using
carpet_core_version=1.4.91+v221207
carpet_core_version=1.4.101+v230319

# Mod Properties
mod_version = 1.13.0
mod_version = 1.14.0
maven_group = carpet-fixes
archives_base_name = carpet-fixes


# Dependencies
# https://github.com/Fallen-Breath/conditional-mixin
conditionalmixin_version = v0.3.1
# https://github.com/2No2Name/McTester
mctester_version = v0.3.0
# https://github.com/LlamaLad7/MixinExtras
mixinextras_version = 0.0.6
# https://github.com/Fallen-Breath/conditional-mixin
conditionalmixin_version = v0.3.1
# https://github.com/2No2Name/McTester
mctester_version = v0.3.0
# https://github.com/LlamaLad7/MixinExtras
mixinextras_version = 0.0.6
18 changes: 0 additions & 18 deletions src/main/java/carpetfixes/CFSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -678,18 +678,6 @@ public class CFSettings {
)
public static boolean structureManagerCantLoadSnbtFix = false;

//by FX - PR0CESS
@Rule(
categories = {BUGFIX}
)
public static boolean stepAndDestroyBlockGoalUsesOriginFix = false;

//by FX - PR0CESS
@Rule(
categories = {BUGFIX}
)
public static boolean hopperMinecartSlowerAtOriginFix = false;

//By FX - PR0CESS
@Rule(
categories = {BUGFIX}
Expand Down Expand Up @@ -852,12 +840,6 @@ public class CFSettings {
)
public static boolean witchAndCatSpawnMergedFix = false;

//By FX - PR0CESS
@Rule(
categories = {BUGFIX}
)
public static boolean jukeboxDiscItemOffsetOnBreakFix = false;

//By FX - PR0CESS
@Rule(
categories = {BUGFIX}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/carpetfixes/helpers/CenterUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ public class CenterUtils {

public static void iterateTouchingBlocks(Entity entity, Consumer<BlockPos.Mutable> perBlock) {
Box box = entity.getBoundingBox();
BlockPos blockPos = new BlockPos(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = new BlockPos(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
BlockPos blockPos = BlockPos.ofFloored(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = BlockPos.ofFloored(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
if (entity.world.isRegionLoaded(blockPos, blockPos2)) {
BlockPos.Mutable mutable = new BlockPos.Mutable();
for(int i = blockPos.getX(); i <= blockPos2.getX(); ++i)
Expand All @@ -30,8 +30,8 @@ public static void iterateTouchingBlocks(Entity entity, Consumer<BlockPos.Mutabl

public static void checkFallCollision(Entity entity, float fallDistance) {
Box box = entity.getBoundingBox();
BlockPos blockPos = new BlockPos(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = new BlockPos(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
BlockPos blockPos = BlockPos.ofFloored(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = BlockPos.ofFloored(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
if (entity.world.isRegionLoaded(blockPos, blockPos2)) {
BlockPos.Mutable mutable = new BlockPos.Mutable();
boolean createdEvent = false;
Expand All @@ -51,8 +51,8 @@ public static void checkFallCollision(Entity entity, float fallDistance) {

public static float checkJumpVelocityOnCollision(Entity entity, World world) {
Box box = entity.getBoundingBox();
BlockPos blockPos = new BlockPos(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = new BlockPos(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
BlockPos blockPos = BlockPos.ofFloored(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = BlockPos.ofFloored(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
if (world.isRegionLoaded(blockPos, blockPos2)) {
double newY = box.minY - VELOCITY_AFFECTING_POS_Y_OFFSET;
BlockPos.Mutable mutable = new BlockPos.Mutable();
Expand Down Expand Up @@ -80,8 +80,8 @@ public static float checkJumpVelocityOnCollision(Entity entity, World world) {

public static float checkVelocityOnCollision(Entity entity, World world) {
Box box = entity.getBoundingBox();
BlockPos blockPos = new BlockPos(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = new BlockPos(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
BlockPos blockPos = BlockPos.ofFloored(box.minX + OFFSET, entity.getBlockY(), box.minZ + OFFSET);
BlockPos blockPos2 = BlockPos.ofFloored(box.maxX - OFFSET, entity.getBlockY(), box.maxZ - OFFSET);
if (world.isRegionLoaded(blockPos, blockPos2)) {
double newY = box.minY - VELOCITY_AFFECTING_POS_Y_OFFSET;
BlockPos.Mutable mutable = new BlockPos.Mutable();
Expand Down
26 changes: 14 additions & 12 deletions src/main/java/carpetfixes/helpers/DelayedWorldEventManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import net.minecraft.util.Pair;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.world.event.GameEvent;

import java.util.ArrayList;
import java.util.HashMap;
Expand All @@ -14,13 +16,13 @@ public class DelayedWorldEventManager {

private static final HashMap<World,List<Pair<Integer,DelayedWorldEvent>>> delayedWorldEvents = new HashMap<>();

public static void addDelayedWorldEvent(World world, int eventId, BlockPos pos, int data) {
addDelayedWorldEvent(world, eventId, pos, data, 1);
public static void addDelayedWorldEvent(World world, GameEvent gameEvent, Vec3d emitterPos, GameEvent.Emitter emitter) {
addDelayedWorldEvent(world, gameEvent, emitterPos, emitter, 1);
}

public static void addDelayedWorldEvent(World world, int eventId, BlockPos pos, int data, int delay) {
public static void addDelayedWorldEvent(World world, GameEvent gameEvent, Vec3d emitterPos, GameEvent.Emitter emitter, int delay) {
delayedWorldEvents.computeIfAbsent(world,(a) -> new ArrayList<>())
.add(new Pair<>(delay,new DelayedWorldEvent(eventId, pos, data)));
.add(new Pair<>(delay, new DelayedWorldEvent(gameEvent, emitterPos, emitter)));
}

public static void tick(World world) {
Expand All @@ -38,18 +40,18 @@ public static void tick(World world) {

static class DelayedWorldEvent {

private final int eventId;
private final BlockPos pos;
private final int data;
private final GameEvent event;
private final Vec3d emitterPos;
private final GameEvent.Emitter emitter;

DelayedWorldEvent(int eventId, BlockPos pos, int data) {
this.eventId = eventId;
this.pos = pos;
this.data = data;
DelayedWorldEvent(GameEvent event, Vec3d emitterPos, GameEvent.Emitter emitter) {
this.event = event;
this.emitterPos = emitterPos;
this.emitter = emitter;
}

public void sendWorldEvent(World world) {
world.syncWorldEvent(null, this.eventId, this.pos, this.data);
world.emitGameEvent(this.event, this.emitterPos, this.emitter);
}
}
}
113 changes: 0 additions & 113 deletions src/main/java/carpetfixes/helpers/RaycastUtils.java

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

import carpetfixes.CFSettings;
import net.minecraft.block.AbstractPressurePlateBlock;
import net.minecraft.block.BlockSetType;
import net.minecraft.block.BlockState;
import net.minecraft.block.PressurePlateBlock;
import net.minecraft.entity.Entity;
import net.minecraft.sound.SoundCategory;
import net.minecraft.state.property.BooleanProperty;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
Expand All @@ -26,8 +28,8 @@ public abstract class PressurePlateBlock_collisionOnPlaceMixin extends AbstractP
@Final
public static BooleanProperty POWERED;

public PressurePlateBlock_collisionOnPlaceMixin(Settings settings) {
super(settings);
public PressurePlateBlock_collisionOnPlaceMixin(Settings settings, BlockSetType blockSetType) {
super(settings, blockSetType);
}

@Override
Expand All @@ -47,10 +49,10 @@ private void tryPowerOnPlace(BlockState state, World world, BlockPos pos) {
world.setBlockState(pos, state.with(POWERED, bl), 3);
this.updateNeighbors(world, pos);
if (bl) {
this.playPressSound(world, pos);
world.playSound(null, pos, this.blockSetType.pressurePlateClickOff(), SoundCategory.BLOCKS);
world.emitGameEvent(list.stream().findFirst().orElse(null), GameEvent.BLOCK_DEACTIVATE, pos);
} else {
this.playDepressSound(world, pos);
world.playSound(null, pos, this.blockSetType.pressurePlateClickOn(), SoundCategory.BLOCKS);
world.emitGameEvent(list.stream().findFirst().orElse(null), GameEvent.BLOCK_ACTIVATE, pos);
}
}
Expand Down
Loading

0 comments on commit 399e4d1

Please sign in to comment.