Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<img alt="Discord" src="https://img.shields.io/discord/855495317298741248?color=brightgreen&label=Discord">
</a>
<br>
<img src="https://i.imgur.com/EFkjwBq.png" width="50%">
<img alt="Brewin' And Chewin' Logo" src="https://i.imgur.com/EFkjwBq.png" width="50%">

### Overview

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ public record ModelEntry(ResourceLocation model, List<? extends TextureModifier>
).apply(inst, ModelEntry::new));
public static final Codec<List<ModelEntry>> LIST_CODEC = Codec.either(ResourceLocation.CODEC, DIRECT_CODEC.listOf())
.xmap(either -> either.map(resourceLocation -> List.of(new ModelEntry(resourceLocation, List.of())), Function.identity()), modelEntry -> {
if (modelEntry.size() == 1 && modelEntry.get(0).modifiers().isEmpty())
return Either.left(modelEntry.get(0).model());
if (modelEntry.size() == 1 && modelEntry.getFirst().modifiers().isEmpty())
return Either.left(modelEntry.getFirst().model());
return Either.right(modelEntry);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,8 +211,6 @@ public <T> DataResult<Pair<Pair<DataComponentType<?>, Map<List<TagReference>, Li
else
BrewinAndChewin.LOG.error("Failed to decode remap value within fluid to item remapping: {}", dataResult.error().get().message());
}
} else {

}

return DataResult.success(Pair.of(Pair.of(componentType, references), input));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ public class FieryFonduePotBlock extends Block {

public FieryFonduePotBlock(Properties properties) {
super(properties);
this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, Integer.valueOf(3)).setValue(FACING, Direction.NORTH));
this.registerDefaultState(this.stateDefinition.any().setValue(LEVEL, 3).setValue(FACING, Direction.NORTH));
}

protected double getContentHeight(BlockState state) {
return (6.0D + (double)state.getValue(LEVEL).intValue() * 3.0D) / 16.0D;
return (6.0D + (double) state.getValue(LEVEL) * 3.0D) / 16.0D;
}

public boolean isEntityInsideContent(BlockState state, BlockPos pos, Entity entity) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,7 @@ private AbstractedFluidTank createFluidTank() {
if (!getLevel().isClientSide() && !currentlyOperating && !deferFluidExtraction) {
List<ItemStack> out = KegBlockEntity.this.extractInGui(handler.getStackInSlot(CONTAINER_SLOT), handler.getSlotLimit(OUTPUT_SLOT));
if (!out.isEmpty())
handler.insertItem(OUTPUT_SLOT, out.get(0), false);
handler.insertItem(OUTPUT_SLOT, out.getFirst(), false);
}
inventoryChanged();
checkNewRecipe = true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ protected void handleRecipeClicked(RecipeHolder<KegFermentingRecipe> recipe, boo
for (int i = 0; i < itemCount; ++i) {
if (itemCount % fermentingRecipe.getFluidIngredient().get().amount() == 0)
break;
insertItems.remove(insertItems.size() - 1);
insertItems.removeLast();
--itemCount;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@ public AbstractedFluidStack getFluid(ItemStack container) {
return new AbstractedFluidStack(fluidStack.fluid(), fluidStack.amount(), PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, patch.build()), getUnit());
}

@Override
public boolean isSpecial() {
return true;
}

@Override
@SuppressWarnings("DataFlowIssue")
public RecipeSerializer<?> getSerializer() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class ChatListenerMixin {
@Shadow @Final private Minecraft minecraft;

@ModifyVariable(method = "showMessageToPlayer", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/multiplayer/chat/ChatListener;evaluateTrustLevel(Lnet/minecraft/network/chat/PlayerChatMessage;Lnet/minecraft/network/chat/Component;Ljava/time/Instant;)Lnet/minecraft/client/multiplayer/chat/ChatTrustLevel;"))
@ModifyVariable(method = "showMessageToPlayer", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/multiplayer/chat/ChatListener;evaluateTrustLevel(Lnet/minecraft/network/chat/PlayerChatMessage;Lnet/minecraft/network/chat/Component;Ljava/time/Instant;)Lnet/minecraft/client/multiplayer/chat/ChatTrustLevel;"), name = "chattrustlevel")
public ChatTrustLevel brewinandchewin$setTipsyChatToModified(ChatTrustLevel original, @Local(argsOnly = true) PlayerChatMessage chatMessage, @Local(argsOnly = true) boolean onlyShowSecureChat) {
if (!(onlyShowSecureChat && !original.isNotSecure()) && !this.minecraft.isBlocked(chatMessage.sender()) && !chatMessage.isFullyFiltered()) {
BnCClientTextUtils.setupChatMessage(chatMessage);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public class GuiMixin {
@Local(argsOnly = true, ordinal = 4) int currentHealth,
@Local(argsOnly = true, ordinal = 5) int displayHealth,
@Local(argsOnly = true, ordinal = 6) int absorptionAmount,
@Local(ordinal = 10) int heartIndex,
@Local(ordinal = 15) int fullHeart) {
@Local(name = "l") int heartIndex,
@Local(name = "i2") int fullHeart) {
if (absorptionAmount <= 0)
brewinandchewin$completedAbsorption = false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class TipsyDrunkRendererMixin {
@Shadow @Final
Minecraft minecraft;

@ModifyVariable(method = "renderLevel", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;mul(Lorg/joml/Matrix4fc;)Lorg/joml/Matrix4f;"))
@ModifyVariable(method = "renderLevel", at = @At(value = "INVOKE", target = "Lorg/joml/Matrix4f;mul(Lorg/joml/Matrix4fc;)Lorg/joml/Matrix4f;"), name = "posestack")
private PoseStack brewinandchewin$renderTipsySpin(PoseStack pose, @Local(argsOnly = true) DeltaTracker delta) {
Player player = Minecraft.getInstance().player;
if (player != null && player.hasEffect(BnCEffects.TIPSY)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@Mixin(targets = "squeek.appleskin.client.HUDOverlayHandler$OffsetsCache")
public class HUDOverlayHandlerMixin {
@ModifyVariable(method = "generate", at = @At(value = "INVOKE", target = "Ljava/util/Vector;get(I)Ljava/lang/Object;", ordinal = 1), ordinal = 7)
@ModifyVariable(method = "generate", at = @At(value = "INVOKE", target = "Ljava/util/Vector;get(I)Ljava/lang/Object;", ordinal = 1), name = "x")
private int brewinandchewin$drawIntoxicationSaturationX(int x, int guiTicks, Player player, @Local(ordinal = 6) int i) {
if (BnCConfiguration.CLIENT_CONFIG.get().intoxicationFoodOverlay() && player.hasEffect(BnCEffects.INTOXICATION)) {
Random rand = new Random();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public IDrawable getIcon() {

@Override
public void setRecipe( IRecipeLayoutBuilder builder, CheeseAgingRecipe recipe, IFocusGroup focusGroup ) {
builder.addSlot(RecipeIngredientRole.INPUT, 9, 26).addItemStack(recipe.getIngredients().get(0).getItems()[0]);
builder.addSlot(RecipeIngredientRole.INPUT, 9, 26).addItemStack(recipe.getIngredients().getFirst().getItems()[0]);
builder.addSlot(RecipeIngredientRole.OUTPUT, 93, 26).addItemStack(RecipeUtils.getResultItem(recipe));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@
"item.brewinandchewin.kombucha": "콤부차",

"effect.brewinandchewin.tipsy": "취기",
"effect.brewinandchewin.tipsy.desc": "화면이 흔들거립니다. 그리고 피해를 받을때 피해를 받았다는 사실을 늦게 받아들이는 취기 체력이 모습을 드러낼 것입니다. 3레벨 이상부턴 당신의 화면이 마음대로 움직입니다. 4레벨부턴, 당신과 상대방이 서로의 채팅이 이상하게 보이게 됩니다. 피해를 받을때 피해를 받았다는 사실을 늦게 받아들이는 취기의 하트가 모습을 드러낼 것입니다.",
"effect.brewinandchewin.tipsy.description": "화면이 흔들거립니다. 그리고 피해를 받을때 피해를 받았다는 사실을 늦게 받아들이는 취기 체력이 모습을 드러낼 것입니다. 3레벨 이상부턴 당신의 화면이 마음대로 움직입니다. 4레벨부턴, 당신과 상대방이 서로의 채팅이 이상하게 보이게 됩니다. 피해를 받을때 피해를 받았다는 사실을 늦게 받아들이는 취기의 하트가 모습을 드러낼 것입니다.",
"effect.brewinandchewin.intoxication": "소화불량",
"effect.brewinandchewin.intoxication.desc": "음식으로부터 포만감을 받지 못하게 됩니다.",
"effect.brewinandchewin.intoxication.description": "음식으로부터 포만감을 받지 못하게 됩니다.",
"effect.brewinandchewin.raging": "격노",
"effect.brewinandchewin.raging.desc": "적을 근접 공격할때마다 공격 속도가 5% 증가합니다. 최대 4회 중첩됩니다.",
"effect.brewinandchewin.raging.description": "적을 근접 공격할때마다 공격 속도가 5% 증가합니다. 최대 4회 중첩됩니다.",
"effect.brewinandchewin.sweet_heart": "달콤한 심장",
"effect.brewinandchewin.sweet_heart.desc": "포만감으로 체력을 회복하는 속도가 항상 빨라집니다",
"effect.brewinandchewin.sweet_heart.description": "포만감으로 체력을 회복하는 속도가 항상 빨라집니다",
"brewinandchewin.tooltip.dread_nog": "흉조 레벨 1 증가",
"brewinandchewin.tooltip.unknown_fluid": "알 수 없는 액체",
"brewinandchewin.container.keg.served_in": "담을 수 있음 : %s",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ public void onInitialize() {
registerNetwork();
registerCompostables();
registerFluidAttributeHandlers();
ServerLifecycleEvents.SERVER_STARTING.register(server -> {
BrewinAndChewinFabric.server = server;
});
ServerLifecycleEvents.SERVER_STOPPED.register(server -> {
BrewinAndChewinFabric.server = null;
});
ServerLifecycleEvents.SERVER_STARTING.register(server -> BrewinAndChewinFabric.server = server);
ServerLifecycleEvents.SERVER_STOPPED.register(server -> BrewinAndChewinFabric.server = null);

EntityTrackingEvents.START_TRACKING.register((entity, player) -> {
if (entity instanceof LivingEntity living) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,17 @@ public void onInitializeClient() {
}
return null;
});
BnCClientSetup.registerReloadListeners(preparableReloadListener -> {
ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new IdentifiableResourceReloadListener() {
@Override
public ResourceLocation getFabricId() {
return preparableReloadListener.getId();
}
BnCClientSetup.registerReloadListeners(preparableReloadListener -> ResourceManagerHelper.get(PackType.CLIENT_RESOURCES).registerReloadListener(new IdentifiableResourceReloadListener() {
@Override
public ResourceLocation getFabricId() {
return preparableReloadListener.getId();
}

@Override
public CompletableFuture<Void> reload(PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller profilerFiller, ProfilerFiller profilerFiller2, Executor executor, Executor executor2) {
return preparableReloadListener.reload(preparationBarrier, resourceManager, profilerFiller, profilerFiller2, executor, executor2);
}
});
});
@Override
public CompletableFuture<Void> reload(PreparationBarrier preparationBarrier, ResourceManager resourceManager, ProfilerFiller profilerFiller, ProfilerFiller profilerFiller2, Executor executor, Executor executor2) {
return preparableReloadListener.reload(preparationBarrier, resourceManager, profilerFiller, profilerFiller2, executor, executor2);
}
}));
BnCClientSetup.registerColorHandlers(ColorProviderRegistry.BLOCK::register);
PreparableModelLoadingPlugin.register(BnCClientSetup::getModels, (data, context) -> {
context.addModels(data.stream().map(resourceLocation -> resourceLocation.withPath(path -> "brewinandchewin/coaster/" + path)).toList());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public boolean test(ItemStack stack) {

@Override
public List<ItemStack> getMatchingStacks() {
List<ItemStack> previewStacks = new ArrayList<>(Arrays.asList(ingredients.get(0).getItems()));
List<ItemStack> previewStacks = new ArrayList<>(Arrays.asList(ingredients.getFirst().getItems()));

for (int i = 1; i < ingredients.size(); ++i) {
Ingredient ing = ingredients.get(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ public abstract class LivingEntityMixin {
return original;
}

@ModifyVariable(method = "updateSynchronizedMobEffectParticles", at = @At(value = "INVOKE_ASSIGN", target = "Ljava/util/stream/Stream;toList()Ljava/util/List;"))
@ModifyVariable(method = "updateSynchronizedMobEffectParticles", at = @At(value = "INVOKE_ASSIGN", target = "Ljava/util/stream/Stream;toList()Ljava/util/List;"), name = "list")
private List<ParticleOptions> brewinandchewin$setToRagingParticles(List<ParticleOptions> original) {
LivingEntity living = (LivingEntity)(Object)this;
return original.stream().map(particleOptions -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TipsyMouseHandlerMixin {
}
}

@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), ordinal = 1)
@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), name = "j")
private double brewinandchewin$smoothCameraMovementX(double original, @Local(argsOnly = true) double movementTime, @Local(ordinal = 4) double f, @Local(ordinal = 5) double g) {
if (minecraft.player != null && !minecraft.player.isSpectator() && !minecraft.options.smoothCamera) {
if (minecraft.player.hasEffect(BnCEffects.TIPSY) && minecraft.player.getEffect(BnCEffects.TIPSY).getAmplifier() > 1) {
Expand All @@ -52,7 +52,7 @@ public class TipsyMouseHandlerMixin {
return original;
}

@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), ordinal = 2)
@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), name = "k")
private double brewinandchewin$smoothCameraMovementY(double original, @Local(argsOnly = true) double movementTime, @Local(ordinal = 4) double f, @Local(ordinal = 5) double g) {
if (minecraft.player != null && !minecraft.player.isSpectator() && !minecraft.options.smoothCamera) {
if (minecraft.player.hasEffect(BnCEffects.TIPSY) && minecraft.player.getEffect(BnCEffects.TIPSY).getAmplifier() > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

@Mixin(ChatListener.class)
public class ChatListenerMixin {
@ModifyVariable(method = "showMessageToPlayer", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/multiplayer/chat/ChatTrustLevel;createTag(Lnet/minecraft/network/chat/PlayerChatMessage;)Lnet/minecraft/client/GuiMessageTag;"))
@ModifyVariable(method = "showMessageToPlayer", at = @At(value = "INVOKE_ASSIGN", target = "Lnet/minecraft/client/multiplayer/chat/ChatTrustLevel;createTag(Lnet/minecraft/network/chat/PlayerChatMessage;)Lnet/minecraft/client/GuiMessageTag;"), name = "guimessagetag")
public GuiMessageTag brewinandchewin$setTipsyChatToModified(GuiMessageTag original, @Local(argsOnly = true) PlayerChatMessage chatMessage, @Local(argsOnly = true) boolean onlyShowSecureChat) {
BnCClientTextUtils.setupChatMessage(chatMessage);
if (BnCClientTextUtils.getTipsyMessage() != null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class TipsyMouseHandlerMixin {
}
}

@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), ordinal = 4)
@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), name = "d0")
private double brewinandchewin$smoothCameraMovementX(double original, @Local(argsOnly = true) double movementTime, @Local(ordinal = 2) double d3, @Local(ordinal = 3) double d4) {
if (minecraft.player != null && !minecraft.player.isSpectator() && !minecraft.options.smoothCamera) {
if (minecraft.player.hasEffect(BnCEffects.TIPSY) && minecraft.player.getEffect(BnCEffects.TIPSY).getAmplifier() > 1) {
Expand All @@ -52,7 +52,7 @@ public class TipsyMouseHandlerMixin {
return original;
}

@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), ordinal = 5)
@ModifyVariable(method = "turnPlayer", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/tutorial/Tutorial;onMouse(DD)V"), name = "d1")
private double brewinandchewin$smoothCameraMovementY(double original, @Local(argsOnly = true) double movementTime, @Local(ordinal = 2) double d3, @Local(ordinal = 3) double d4) {
if (minecraft.player != null && !minecraft.player.isSpectator() && !minecraft.options.smoothCamera) {
if (minecraft.player.hasEffect(BnCEffects.TIPSY) && minecraft.player.getEffect(BnCEffects.TIPSY).getAmplifier() > 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void sendServerbound(CustomPacketPayload payload) {

@Override
public Component getFluidDisplayName(AbstractedFluidStack wrapper) {
return wrapper.loaderSpecific() instanceof FluidStack fluidStack ? fluidStack.getHoverName() : Component.translatable("");
return wrapper.loaderSpecific() instanceof FluidStack fluidStack ? fluidStack.getHoverName() : Component.empty();
}

@Override
Expand Down