FluidStackHooks.java 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151
  1. /*
  2. * This file is part of architectury.
  3. * Copyright (C) 2020, 2021 architectury
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 3 of the License, or (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public License
  16. * along with this program; if not, write to the Free Software Foundation,
  17. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  18. */
  19. package me.shedaniel.architectury.hooks;
  20. import me.shedaniel.architectury.annotations.ExpectPlatform;
  21. import me.shedaniel.architectury.fluid.FluidStack;
  22. import me.shedaniel.architectury.utils.Fraction;
  23. import net.fabricmc.api.EnvType;
  24. import net.fabricmc.api.Environment;
  25. import net.minecraft.client.renderer.texture.TextureAtlasSprite;
  26. import net.minecraft.core.BlockPos;
  27. import net.minecraft.nbt.CompoundTag;
  28. import net.minecraft.network.FriendlyByteBuf;
  29. import net.minecraft.network.chat.Component;
  30. import net.minecraft.world.level.BlockAndTintGetter;
  31. import net.minecraft.world.level.material.Fluid;
  32. import net.minecraft.world.level.material.FluidState;
  33. import org.jetbrains.annotations.Nullable;
  34. public class FluidStackHooks {
  35. private FluidStackHooks() {}
  36. @ExpectPlatform
  37. public static Component getName(FluidStack stack) {
  38. throw new AssertionError();
  39. }
  40. @ExpectPlatform
  41. public static String getTranslationKey(FluidStack stack) {
  42. throw new AssertionError();
  43. }
  44. /**
  45. * Platform-specific FluidStack read.
  46. */
  47. @ExpectPlatform
  48. public static FluidStack read(FriendlyByteBuf buf) {
  49. throw new AssertionError();
  50. }
  51. /**
  52. * Platform-specific FluidStack write.
  53. */
  54. @ExpectPlatform
  55. public static void write(FluidStack stack, FriendlyByteBuf buf) {
  56. throw new AssertionError();
  57. }
  58. /**
  59. * Platform-specific FluidStack read.
  60. */
  61. @ExpectPlatform
  62. public static FluidStack read(CompoundTag tag) {
  63. throw new AssertionError();
  64. }
  65. /**
  66. * Platform-specific FluidStack write.
  67. */
  68. @ExpectPlatform
  69. public static CompoundTag write(FluidStack stack, CompoundTag tag) {
  70. throw new AssertionError();
  71. }
  72. /**
  73. * Platform-specific bucket amount.
  74. * Forge: 1000
  75. * Fabric: 1
  76. */
  77. @ExpectPlatform
  78. public static Fraction bucketAmount() {
  79. throw new AssertionError();
  80. }
  81. @ExpectPlatform
  82. @Environment(EnvType.CLIENT)
  83. @Nullable
  84. public static TextureAtlasSprite getStillTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
  85. throw new AssertionError();
  86. }
  87. @ExpectPlatform
  88. @Environment(EnvType.CLIENT)
  89. @Nullable
  90. public static TextureAtlasSprite getStillTexture(FluidStack stack) {
  91. throw new AssertionError();
  92. }
  93. @ExpectPlatform
  94. @Environment(EnvType.CLIENT)
  95. @Nullable
  96. public static TextureAtlasSprite getStillTexture(Fluid fluid) {
  97. throw new AssertionError();
  98. }
  99. @ExpectPlatform
  100. @Environment(EnvType.CLIENT)
  101. @Nullable
  102. public static TextureAtlasSprite getFlowingTexture(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
  103. throw new AssertionError();
  104. }
  105. @ExpectPlatform
  106. @Environment(EnvType.CLIENT)
  107. @Nullable
  108. public static TextureAtlasSprite getFlowingTexture(FluidStack stack) {
  109. throw new AssertionError();
  110. }
  111. @ExpectPlatform
  112. @Environment(EnvType.CLIENT)
  113. @Nullable
  114. public static TextureAtlasSprite getFlowingTexture(Fluid fluid) {
  115. throw new AssertionError();
  116. }
  117. @ExpectPlatform
  118. @Environment(EnvType.CLIENT)
  119. public static int getColor(@Nullable BlockAndTintGetter level, @Nullable BlockPos pos, FluidState state) {
  120. throw new AssertionError();
  121. }
  122. @ExpectPlatform
  123. @Environment(EnvType.CLIENT)
  124. public static int getColor(FluidStack stack) {
  125. throw new AssertionError();
  126. }
  127. @ExpectPlatform
  128. @Environment(EnvType.CLIENT)
  129. public static int getColor(Fluid fluid) {
  130. throw new AssertionError();
  131. }
  132. }