Lowered minecart's extra size so it won't block the player's view

master
Wynd 2023-04-08 01:24:18 +03:00
parent 21cf7a6aeb
commit 1886b964d0
3 changed files with 11 additions and 7 deletions

View File

@ -24,7 +24,7 @@ public class WyHelper {
Random rand = new Random();
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
// player.dropItem(new ItemInstance(Tile.GLASS, 1), false);
// player.dropItem(new ItemInstance(Tile.DIRT, 1), false);
// player.dropItem(new ItemInstance(ItemType.bow, 1), false);
// player.dropItem(new ItemInstance(ItemType.arrow, 64), false);

View File

@ -18,6 +18,9 @@ import xyz.pixelatedw.betterbeta.WyHelper;
@Mixin(Minecart.class)
public class MinecartMixin {
private static final double EXTRA_MINECART_XZ_SIZE = 0.3;
private static final double EXTRA_MINECART_Y_SIZE = 0.1;
@Inject(method = "method_1379", at = @At("HEAD"), cancellable = true)
public void onCollision(Entity other, CallbackInfoReturnable<Box> ci) {
if(other instanceof ItemEntity || other instanceof Arrow) {
@ -33,15 +36,13 @@ public class MinecartMixin {
int z = MathsHelper.floor(minecart.z);
int tileId = minecart.level.getTileId(x, y, z);
if (RailTile.method_1107(tileId)) {
if(minecart.passenger != null) {
minecart.boundingBox.set(minecart.boundingBox.minX - 0.5, minecart.boundingBox.minY - 0.5, minecart.boundingBox.minZ - 0.5, minecart.boundingBox.maxX + 0.5, minecart.boundingBox.maxY + 0.5, minecart.boundingBox.maxZ + 0.5);
}
float speed = MathsHelper.sqrt(minecart.velocityX * minecart.velocityX + minecart.velocityZ * minecart.velocityZ);
float volume = 0;
float pitch = 0;
if (speed >= 0.01D) {
if(minecart.passenger != null) {
minecart.boundingBox.set(minecart.boundingBox.minX - EXTRA_MINECART_XZ_SIZE, minecart.boundingBox.minY, minecart.boundingBox.minZ - EXTRA_MINECART_XZ_SIZE, minecart.boundingBox.maxX + EXTRA_MINECART_XZ_SIZE, minecart.boundingBox.maxY + EXTRA_MINECART_Y_SIZE, minecart.boundingBox.maxZ + EXTRA_MINECART_XZ_SIZE);
}
++minecart.field_1645;
pitch = WyHelper.clamp(pitch + 0.0025F, 0.0F, 1.0F);
volume = WyHelper.lerp(WyHelper.clamp(speed, 0.0F, 0.5F), 0.0F, 0.7F);

View File

@ -8,8 +8,11 @@ import net.minecraft.client.util.ResourceDownloadThread;
@Mixin(ResourceDownloadThread.class)
public class ResourceDownloadThreadMixin {
private static final String RESOURCES_URL = "http://mcresources.modification-station.net/MinecraftResources/";
@ModifyConstant(method = "run", constant = @Constant(stringValue = "http://s3.amazonaws.com/MinecraftResources/"), remap = false)
private String getResourcesUrl(String def) {
return "http://mcresources.modification-station.net/MinecraftResources/";
return RESOURCES_URL;
}
}