mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-27 17:28:34 +01:00
Compare commits
18 commits
817797ad3a
...
3f356896b7
Author | SHA1 | Date | |
---|---|---|---|
|
3f356896b7 | ||
|
53414c434a | ||
|
0a6aa6545b | ||
|
fc20f4a94a | ||
|
09673dd118 | ||
|
d4cc7b0737 | ||
|
56402e46eb | ||
|
ba64232ac1 | ||
|
53e4cb8a9b | ||
|
4a36c696ab | ||
|
83828a6def | ||
|
f1c7b2491e | ||
|
951355bf05 | ||
|
f758e8beac | ||
|
4b55999af3 | ||
|
323c07568d | ||
|
73f7af4dbf | ||
|
bbf42da613 |
19 changed files with 115 additions and 113 deletions
|
@ -1,4 +1,4 @@
|
|||
// 1.20.4 2024-03-08T16:41:19.1669609 Recipes
|
||||
// 1.20.4 2024-03-09T11:39:13.7182875 Recipes
|
||||
4d3128b37a7153882a9324cda49b5069207561c5 data/actuallyadditions/recipes/atomic_reconstructor.json
|
||||
b0367f5012651764931e8b8fd0c5bcca4e8614c0 data/actuallyadditions/recipes/battery_box.json
|
||||
fe704716268e01ca8aeeb92196d9f660b9e08640 data/actuallyadditions/recipes/black_quartz_brick_slab.json
|
||||
|
@ -32,6 +32,7 @@ e2f9ec08306500d981cad22bc2cf7925712d08de data/actuallyadditions/recipes/fermenti
|
|||
9c1e45adf3ad5ef64044ac111ef1ac2a57a498d0 data/actuallyadditions/recipes/firework_box.json
|
||||
2391a543a2e43ff5b87234a71d9bd339f9fa3e9c data/actuallyadditions/recipes/fluid_collector.json
|
||||
2614b2743071b86fd6d2cb92063c3e95a959e52c data/actuallyadditions/recipes/fluid_placer.json
|
||||
f9fe1f2a3e4a73f9cfd4cda43a19f4730f3f6963 data/actuallyadditions/recipes/greenhouse_glass.json
|
||||
ff81da8a0f6632779414c0512100696a11771814 data/actuallyadditions/recipes/hopping_item_interface.json
|
||||
48d208a519aaa44547dbca19a57cc66e4e0ab46c data/actuallyadditions/recipes/iron_casing.json
|
||||
5d0c6fc708579565c21e0992796ba6f403473ed7 data/actuallyadditions/recipes/item_interface.json
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"type": "minecraft:crafting_shaped",
|
||||
"category": "misc",
|
||||
"key": {
|
||||
"E": {
|
||||
"item": "actuallyadditions:empowered_palis_crystal"
|
||||
},
|
||||
"G": {
|
||||
"tag": "forge:glass"
|
||||
},
|
||||
"S": {
|
||||
"tag": "minecraft:saplings"
|
||||
}
|
||||
},
|
||||
"pattern": [
|
||||
"GSG",
|
||||
"SES",
|
||||
"GSG"
|
||||
],
|
||||
"result": {
|
||||
"count": 2,
|
||||
"item": "actuallyadditions:greenhouse_glass"
|
||||
}
|
||||
}
|
|
@ -314,7 +314,13 @@ public class BlockRecipeGenerator extends RecipeProvider {
|
|||
.define('I', ActuallyBlocks.IRON_CASING.getItem())
|
||||
.save(recipeOutput);
|
||||
|
||||
|
||||
// Greenhouse glass
|
||||
Recipe.shaped(ActuallyBlocks.GREENHOUSE_GLASS.getItem(), 2)
|
||||
.pattern("GSG", "SES", "GSG")
|
||||
.define('G', Tags.Items.GLASS)
|
||||
.define('S', ItemTags.SAPLINGS)
|
||||
.define('E', ActuallyItems.EMPOWERED_PALIS_CRYSTAL)
|
||||
.save(recipeOutput);
|
||||
}
|
||||
|
||||
public static class Recipe {
|
||||
|
|
|
@ -35,16 +35,17 @@ public class BlockCoffeeMachine extends DirectionalBlock.Container {
|
|||
|
||||
@Override
|
||||
public InteractionResult use(BlockState state, Level world, BlockPos pos, Player player, InteractionHand hand, BlockHitResult hit) {
|
||||
if (!world.isClientSide) {
|
||||
if (world.isClientSide) {
|
||||
return InteractionResult.SUCCESS;
|
||||
} else {
|
||||
TileEntityCoffeeMachine tile = (TileEntityCoffeeMachine) world.getBlockEntity(pos);
|
||||
if (tile != null) {
|
||||
if (!this.tryUseItemOnTank(player, hand, tile.tank)) {
|
||||
player.openMenu(tile, pos);
|
||||
}
|
||||
}
|
||||
return InteractionResult.PASS;
|
||||
return InteractionResult.CONSUME;
|
||||
}
|
||||
return super.use(state, world, pos, player, hand, hit);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
|
|
@ -45,7 +45,6 @@ import static net.minecraft.world.level.block.state.properties.BlockStatePropert
|
|||
|
||||
public class BlockPoweredFurnace extends DirectionalBlock.Container {
|
||||
public BlockPoweredFurnace() {
|
||||
// TODO: [port] confirm this is correct for light level... Might not be reactive.
|
||||
super(ActuallyBlocks.defaultPickProps().randomTicks().lightLevel(state -> state.getValue(LIT)
|
||||
? 12
|
||||
: 0));
|
||||
|
|
|
@ -165,7 +165,7 @@ public class ClientEvents {
|
|||
@SubscribeEvent
|
||||
public void onGameOverlay(RenderGuiOverlayEvent.Post event) {
|
||||
Minecraft minecraft = Minecraft.getInstance();
|
||||
if (event.getOverlay() == GuiOverlayManager.findOverlay(new ResourceLocation("crosshair")) && minecraft.screen == null) { //ALL
|
||||
if (event.getOverlay() == GuiOverlayManager.findOverlay(new ResourceLocation("portal")) && minecraft.screen == null) { //ALL
|
||||
GuiGraphics guiGraphics = event.getGuiGraphics();
|
||||
Player player = minecraft.player;
|
||||
if (player == null) {
|
||||
|
@ -202,7 +202,7 @@ public class ClientEvents {
|
|||
if (!stack.isEmpty() && stack.getItem() == CommonConfig.Other.redstoneConfigureItem) {
|
||||
expl = ChatFormatting.GREEN + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.validItem");
|
||||
} else {
|
||||
expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", I18n.get(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()));
|
||||
expl = ChatFormatting.GRAY.toString() + ChatFormatting.ITALIC + I18n.get("info." + ActuallyAdditions.MODID + ".redstoneMode.invalidItem", I18n.get(CommonConfig.Other.redstoneConfigureItem.asItem().getDescriptionId()));
|
||||
}
|
||||
guiGraphics.drawString(font, expl, (int) (event.getWindow().getGuiScaledWidth() / 2f + 5), (int) (event.getWindow().getGuiScaledHeight() / 2f + 15), 0xFFFFFF);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class ContainerCoffeeMachine extends AbstractContainerMenu {
|
|||
//Other Slots in Inventory excluded
|
||||
else if (slot >= inventoryStart) {
|
||||
//Shift from Inventory
|
||||
if (newStack.getItem() == ActuallyItems.COFFEE_CUP.get()) {
|
||||
if (newStack.getItem() == ActuallyItems.EMPTY_CUP.get()) {
|
||||
if (!this.moveItemStackTo(newStack, TileEntityCoffeeMachine.SLOT_INPUT, TileEntityCoffeeMachine.SLOT_INPUT + 1, false)) {
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ public class EnergyDisplay {
|
|||
}
|
||||
|
||||
if (this.drawTextNextTo) {
|
||||
//this.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, StringUtil.DECIMAL_COLOR_WHITE);
|
||||
guiGraphics.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, 0xFFFFFF);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -80,8 +80,8 @@ public class EnergyDisplay {
|
|||
Minecraft mc = Minecraft.getInstance();
|
||||
|
||||
List<Component> text = new ArrayList<>();
|
||||
text.add(Component.literal(this.getOverlayText()));
|
||||
guiGraphics.renderComponentTooltip(mc.font, text, mouseX, mouseY); //TODO: Check if this is correct, used to call GuiUtils.drawHoveringText
|
||||
text.add(this.getOverlayText());
|
||||
guiGraphics.renderComponentTooltip(mc.font, text, mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -93,11 +93,10 @@ public class EnergyDisplay {
|
|||
: 85);
|
||||
}
|
||||
|
||||
private String getOverlayText() {
|
||||
private Component getOverlayText() {
|
||||
NumberFormat format = NumberFormat.getInstance();
|
||||
return Component.translatable("misc.actuallyadditions.power_long",
|
||||
format.format(this.rfReference.getEnergyStored()),
|
||||
format.format(this.rfReference.getMaxEnergyStored()))
|
||||
.getString();
|
||||
format.format(this.rfReference.getMaxEnergyStored()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,12 +10,13 @@
|
|||
|
||||
package de.ellpeck.actuallyadditions.mod.inventory.gui;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import de.ellpeck.actuallyadditions.mod.util.AssetUtil;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.FastColor;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import net.neoforged.api.distmarker.Dist;
|
||||
import net.neoforged.api.distmarker.OnlyIn;
|
||||
|
@ -88,29 +89,35 @@ public class FluidDisplay {
|
|||
FluidStack stack = this.fluidReference.getFluid();
|
||||
Fluid fluid = stack.getFluid();
|
||||
|
||||
if (this.resLoc == null || this.oldFluid != stack.getFluid()) {
|
||||
this.oldFluid = stack.getFluid();
|
||||
if (stack != null && !stack.isEmpty() && fluid != null) {
|
||||
IClientFluidTypeExtensions fluidTypeExtension = IClientFluidTypeExtensions.of(fluid);
|
||||
int color = fluidTypeExtension.getTintColor(stack);
|
||||
float red = (float)(FastColor.ARGB32.red(color) / 255.0);
|
||||
float green = (float)(FastColor.ARGB32.green(color) / 255.0);
|
||||
float blue = (float)(FastColor.ARGB32.blue(color) / 255.0);
|
||||
float alpha = (float)(FastColor.ARGB32.alpha(color) / 255.0);
|
||||
|
||||
if (fluid != null && IClientFluidTypeExtensions.of(fluid).getStillTexture() != null) {
|
||||
this.resLoc = new ResourceLocation(IClientFluidTypeExtensions.of(fluid).getStillTexture().getNamespace(), "textures/" + IClientFluidTypeExtensions.of(fluid).getStillTexture().getPath() + ".png");
|
||||
if (this.resLoc == null || this.oldFluid != stack.getFluid()) {
|
||||
this.oldFluid = stack.getFluid();
|
||||
|
||||
if (fluidTypeExtension.getStillTexture() != null) {
|
||||
this.resLoc = new ResourceLocation(fluidTypeExtension.getStillTexture().getNamespace(), "textures/" + IClientFluidTypeExtensions.of(fluid).getStillTexture().getPath() + ".png");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (stack != null && fluid != null && this.resLoc != null) {
|
||||
// GlStateManager._pushMatrix();
|
||||
GlStateManager._enableBlend();
|
||||
// GlStateManager._disableAlphaTest();
|
||||
GlStateManager._blendFuncSeparate(770, 771, 1, 0);
|
||||
int i = this.fluidReference.getFluid().getAmount() * 83 / this.fluidReference.getCapacity();
|
||||
guiGraphics.blit(this.resLoc, barX + 1, barY + 84 - i, 0, 0, 16, i, 16, 512);
|
||||
//drawModalRectWithCustomSizedTexture(barX + 1, barY + 84 - i, 36, 172, 16, i, 16, 512);
|
||||
GlStateManager._disableBlend();
|
||||
// GlStateManager._enableAlphaTest();
|
||||
// GlStateManager._popMatrix();
|
||||
}
|
||||
if (this.resLoc != null) {
|
||||
RenderSystem.setShaderColor(red, green, blue, alpha);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.blendFuncSeparate(770, 771, 1, 0);
|
||||
int i = this.fluidReference.getFluid().getAmount() * 83 / this.fluidReference.getCapacity();
|
||||
guiGraphics.blit(this.resLoc, barX + 1, barY + 84 - i, 0, 0, 16, i, 16, 512);
|
||||
RenderSystem.disableBlend();
|
||||
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if (this.drawTextNextTo) {
|
||||
guiGraphics.drawString(mc.font, Component.literal(this.getOverlayText()), barX + 25, barY + 78, 0xFFFFFF, false);
|
||||
if (this.drawTextNextTo) {
|
||||
guiGraphics.drawString(mc.font, this.getOverlayText(), barX + 25, barY + 78, 0xFFFFFF, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -121,17 +128,17 @@ public class FluidDisplay {
|
|||
? 93
|
||||
: 85)) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
guiGraphics.renderComponentTooltip(mc.font, Collections.singletonList(Component.literal(this.getOverlayText())), mouseX, mouseY); //TODO: Check if this is correct, used to call GuiUtils.drawHoveringText
|
||||
guiGraphics.renderComponentTooltip(mc.font, Collections.singletonList(this.getOverlayText()), mouseX, mouseY);
|
||||
}
|
||||
}
|
||||
|
||||
private String getOverlayText() {
|
||||
private Component getOverlayText() {
|
||||
NumberFormat format = NumberFormat.getInstance();
|
||||
FluidStack stack = this.fluidReference.getFluid();
|
||||
String cap = format.format(this.fluidReference.getCapacity());
|
||||
return stack.isEmpty()
|
||||
? "0/" + cap + " mB"
|
||||
: format.format(this.fluidReference.getFluidAmount()) + (drawCapacityInTooltip?"/" + cap + " mB ":" mB ") + stack.getDisplayName().getString();
|
||||
? Component.literal("0/" + cap + " mB")
|
||||
: Component.literal(format.format(this.fluidReference.getFluidAmount()) + (drawCapacityInTooltip?"/" + cap + " mB ":" mB ")).append(stack.getDisplayName());
|
||||
}
|
||||
|
||||
public static class DummyTank implements IFluidTank {
|
||||
|
|
|
@ -61,7 +61,7 @@ public class GuiFurnaceDouble extends AAScreen<ContainerFurnaceDouble> {
|
|||
super.init();
|
||||
this.energy = new EnergyDisplay(this.leftPos + 27, this.topPos + 5, this.tileFurnace.storage);
|
||||
this.buttonAutoSplit = Button.builder(Component.literal("S"), (button) -> PacketHandlerHelper.sendButtonPacket(this.tileFurnace, 0))
|
||||
.bounds(this.leftPos + 27, this.topPos + 5, 16, 16).build();
|
||||
.bounds(this.getGuiLeft(), 30, 16, 16).build();
|
||||
buttonAutoSplit.setFGColor(this.tileFurnace.isAutoSplit ? ChatFormatting.DARK_GREEN.getColor() : ChatFormatting.RED.getColor());
|
||||
this.addRenderableWidget(this.buttonAutoSplit);
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ public class ItemCoffee extends ItemBase {
|
|||
if (effects != null) {
|
||||
for (MobEffectInstance effect : effects) {
|
||||
tooltip.add(Component.translatable(effect.getDescriptionId())
|
||||
.append(" " + (effect.getAmplifier() + 1) + ", " + StringUtil.formatTickDuration(effect.getDuration(), 20))
|
||||
.append(" " + (effect.getAmplifier() + 1) + ", " + StringUtil.formatTickDuration(effect.getDuration(), 1))
|
||||
.withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -6,6 +6,8 @@ import net.minecraft.world.item.Item;
|
|||
* I'm using a custom class here as I'm sure we'll need a unified way of declaring rules
|
||||
* but also so we can always know if something is ours in the simplest form.
|
||||
*/
|
||||
// Superseded by ItemBase
|
||||
@Deprecated
|
||||
public abstract class ActuallyItem extends Item implements IActuallyItem {
|
||||
public ActuallyItem(Properties properties) {
|
||||
super(properties);
|
||||
|
|
|
@ -3,6 +3,8 @@ package de.ellpeck.actuallyadditions.mod.items.misc;
|
|||
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ActuallyItem;
|
||||
|
||||
// Superseded by ItemDrillUpgrade
|
||||
@Deprecated
|
||||
public class DrillAugmentItem extends ActuallyItem {
|
||||
private final AugmentType type;
|
||||
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
package de.ellpeck.actuallyadditions.mod.items.misc;
|
||||
|
||||
|
||||
import de.ellpeck.actuallyadditions.mod.items.base.ActuallyItem;
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
||||
public class YummyItem extends ActuallyItem {
|
||||
private final Foods food;
|
||||
|
||||
public YummyItem(Foods food) {
|
||||
super(baseProps().food(food.food));
|
||||
|
||||
this.food = food;
|
||||
}
|
||||
|
||||
public enum Foods {
|
||||
CHEESE(new FoodProperties.Builder().nutrition(1).saturationMod(0.05F), 3),
|
||||
PUMPKIN_STEW(new FoodProperties.Builder().nutrition(6).saturationMod(0.3F), 30, true, new ItemStack(Items.BOWL)),
|
||||
CARROT_JUICE(new FoodProperties.Builder().nutrition(4).saturationMod(0.2F), 20, true, new ItemStack(Items.GLASS_BOTTLE)),
|
||||
FRENCH_FRY(new FoodProperties.Builder().nutrition(2).saturationMod(0.025F), 3),
|
||||
SPAGHETTI(new FoodProperties.Builder().nutrition(7).saturationMod(0.4F), 38, new ItemStack(Items.BOWL)),
|
||||
NOODLE(new FoodProperties.Builder().nutrition(1).saturationMod(0.01F), 3),
|
||||
CHOCOLATE_CAKE(new FoodProperties.Builder().nutrition(16).saturationMod(0.8F), 45),
|
||||
CHOCOLATE(new FoodProperties.Builder().nutrition(3).saturationMod(0.3F), 15),
|
||||
TOAST(new FoodProperties.Builder().nutrition(3).saturationMod(0.08F), 25),
|
||||
SUBMARINE_SANDWICH(new FoodProperties.Builder().nutrition(9).saturationMod(0.4F), 40),
|
||||
BIG_COOKIE(new FoodProperties.Builder().nutrition(4).saturationMod(0.25F), 20),
|
||||
HAMBURGER(new FoodProperties.Builder().nutrition(13).saturationMod(0.65F), 40),
|
||||
PIZZA(new FoodProperties.Builder().nutrition(16).saturationMod(0.8F), 45),
|
||||
BAGUETTE(new FoodProperties.Builder().nutrition(6).saturationMod(0.5F), 25),
|
||||
RICE(new FoodProperties.Builder().nutrition(2).saturationMod(0.05F), 10),
|
||||
RICE_BREAD(new FoodProperties.Builder().nutrition(6).saturationMod(0.5F), 25),
|
||||
DOUGHNUT(new FoodProperties.Builder().nutrition(2).saturationMod(0.1F), 10),
|
||||
CHOCOLATE_TOAST(new FoodProperties.Builder().nutrition(5).saturationMod(0.2F), 40),
|
||||
BACON(new FoodProperties.Builder().nutrition(4).saturationMod(0.1F), 30);
|
||||
|
||||
FoodProperties food;
|
||||
int useDuration;
|
||||
boolean isDrunken;
|
||||
ItemStack returnItem;
|
||||
|
||||
Foods(FoodProperties.Builder food, int useDuration, boolean isDrunken, ItemStack returnItem) {
|
||||
this.food = food.build();
|
||||
this.useDuration = useDuration;
|
||||
this.isDrunken = isDrunken;
|
||||
this.returnItem = returnItem;
|
||||
}
|
||||
|
||||
Foods(FoodProperties.Builder food, int useDuration) {
|
||||
this(food, useDuration, false, ItemStack.EMPTY);
|
||||
}
|
||||
|
||||
Foods(FoodProperties.Builder food, int useDuration, ItemStack returnItem) {
|
||||
this(food, useDuration, false, returnItem);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -17,6 +17,8 @@ import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
|||
import de.ellpeck.actuallyadditions.mod.crafting.EmpowererRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.FermentingRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiCoffeeMachine;
|
||||
import de.ellpeck.actuallyadditions.mod.inventory.gui.GuiFurnaceDouble;
|
||||
import de.ellpeck.actuallyadditions.mod.items.ActuallyItems;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.coffee.CoffeeMachineCategory;
|
||||
import de.ellpeck.actuallyadditions.mod.jei.empowerer.EmpowererRecipeCategory;
|
||||
|
@ -27,6 +29,7 @@ import mezz.jei.api.JeiPlugin;
|
|||
import mezz.jei.api.constants.RecipeTypes;
|
||||
import mezz.jei.api.helpers.IJeiHelpers;
|
||||
import mezz.jei.api.recipe.RecipeType;
|
||||
import mezz.jei.api.registration.IGuiHandlerRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCatalystRegistration;
|
||||
import mezz.jei.api.registration.IRecipeCategoryRegistration;
|
||||
import mezz.jei.api.registration.IRecipeRegistration;
|
||||
|
@ -88,7 +91,13 @@ public class JEIActuallyAdditionsPlugin implements IModPlugin {
|
|||
//registry.addRecipes(ActuallyAdditionsAPI.CRUSHER_RECIPES, CrusherRecipeCategory.NAME);
|
||||
}
|
||||
|
||||
// @Override
|
||||
@Override
|
||||
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
|
||||
registration.addRecipeClickArea(GuiCoffeeMachine.class, 53, 42, 22, 16, COFFEE_MACHINE);
|
||||
registration.addRecipeClickArea(GuiFurnaceDouble.class, 51, 40, 74, 22, RecipeTypes.SMELTING);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void register(IModRegistry registry) {
|
||||
// IJeiHelpers helpers = registry.getJeiHelpers();
|
||||
//
|
||||
|
|
|
@ -14,6 +14,7 @@ import de.ellpeck.actuallyadditions.api.internal.IAtomicReconstructor;
|
|||
import de.ellpeck.actuallyadditions.api.internal.IMethodHandler;
|
||||
import de.ellpeck.actuallyadditions.api.lens.Lens;
|
||||
import de.ellpeck.actuallyadditions.api.recipe.CoffeeIngredient;
|
||||
import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
||||
import de.ellpeck.actuallyadditions.mod.blocks.BlockLaserRelay;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.CoffeeIngredientRecipe;
|
||||
import de.ellpeck.actuallyadditions.mod.crafting.LaserRecipe;
|
||||
|
@ -24,7 +25,10 @@ import net.minecraft.core.Direction;
|
|||
import net.minecraft.core.Vec3i;
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.nbt.CompoundTag;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.effect.MobEffect;
|
||||
import net.minecraft.world.effect.MobEffectInstance;
|
||||
import net.minecraft.world.effect.MobEffects;
|
||||
import net.minecraft.world.entity.item.ItemEntity;
|
||||
import net.minecraft.world.item.BlockItem;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
|
@ -123,7 +127,7 @@ public class MethodHandler implements IMethodHandler {
|
|||
|
||||
int prevCounter = tag.getInt("Counter");
|
||||
CompoundTag compound = new CompoundTag();
|
||||
//compound.putInt("ID", Potion.getIdFromPotion(effect.getEffect())); //TODO ?!
|
||||
compound.putString("ID", BuiltInRegistries.MOB_EFFECT.getKey(effect.getEffect()).toString());
|
||||
compound.putInt("Duration", effect.getDuration());
|
||||
compound.putInt("Amplifier", effect.getAmplifier());
|
||||
|
||||
|
@ -140,13 +144,20 @@ public class MethodHandler implements IMethodHandler {
|
|||
CompoundTag tag = stack.getOrCreateTag();
|
||||
int counter = tag.getInt("Counter");
|
||||
while (counter > 0) {
|
||||
CompoundTag compound = (CompoundTag) tag.get(counter + "");
|
||||
MobEffectInstance effect = new MobEffectInstance(BuiltInRegistries.MOB_EFFECT.byId(compound.getInt("ID")), compound.getInt("Duration"), compound.getByte("Amplifier"));
|
||||
effects.add(effect);
|
||||
CompoundTag compound = tag.getCompound(counter + "");
|
||||
String id = compound.getString("ID");
|
||||
ResourceLocation effectID = id.isEmpty() ? new ResourceLocation("speed") : ResourceLocation.tryParse(id);
|
||||
MobEffect effect = BuiltInRegistries.MOB_EFFECT.get(effectID);
|
||||
if (effect == null) {
|
||||
ActuallyAdditions.LOGGER.error("Unable to find effect with ID: {}, defaulting to speed", effectID);
|
||||
effect = MobEffects.MOVEMENT_SPEED;
|
||||
}
|
||||
MobEffectInstance effectInstance = new MobEffectInstance(effect, compound.getInt("Duration"), compound.getByte("Amplifier"));
|
||||
effects.add(effectInstance);
|
||||
counter--;
|
||||
}
|
||||
return effects.size() > 0
|
||||
? effects.toArray(new MobEffectInstance[effects.size()])
|
||||
return !effects.isEmpty()
|
||||
? effects.toArray(new MobEffectInstance[0])
|
||||
: null;
|
||||
}
|
||||
|
||||
|
|
|
@ -183,7 +183,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
ItemStack input = this.inv.getStackInSlot(SLOT_INPUT);
|
||||
if (StackUtil.isValid(input) && input.getItem() == ActuallyItems.COFFEE_CUP.get() && !StackUtil.isValid(this.inv.getStackInSlot(SLOT_OUTPUT)) && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid().getFluid() == Fluids.WATER && this.tank.getFluidAmount() >= WATER_USE) {
|
||||
if (!input.isEmpty() && input.is(ActuallyItems.EMPTY_CUP) && this.inv.getStackInSlot(SLOT_OUTPUT).isEmpty() && this.coffeeCacheAmount >= CACHE_USE && this.tank.getFluid().getFluid() == Fluids.WATER && this.tank.getFluidAmount() >= WATER_USE) {
|
||||
if (this.storage.getEnergyStored() >= ENERGY_USED) {
|
||||
if (this.brewTime % 30 == 0) {
|
||||
this.level.playSound(null, this.getBlockPos().getX(), this.getBlockPos().getY(), this.getBlockPos().getZ(), AASounds.COFFEE_MACHINE.get(), SoundSource.BLOCKS, 0.1F, 1.0F);
|
||||
|
@ -193,7 +193,7 @@ public class TileEntityCoffeeMachine extends TileEntityInventoryBase implements
|
|||
this.storage.extractEnergyInternal(ENERGY_USED, false);
|
||||
if (this.brewTime >= TIME_USED) {
|
||||
this.brewTime = 0;
|
||||
ItemStack output = new ItemStack(ActuallyItems.COFFEE_BEANS.get());
|
||||
ItemStack output = new ItemStack(ActuallyItems.COFFEE_CUP.get());
|
||||
for (int i = 3; i < this.inv.getSlots(); i++) {
|
||||
if (StackUtil.isValid(this.inv.getStackInSlot(i))) {
|
||||
RecipeHolder<CoffeeIngredientRecipe> recipeHolder = ItemCoffee.getIngredientRecipeFromStack(this.inv.getStackInSlot(i));
|
||||
|
|
|
@ -174,7 +174,7 @@ public class TileEntityPoweredFurnace extends TileEntityInventoryBase implements
|
|||
}
|
||||
|
||||
if (changeTo != current) {
|
||||
tile.level.setBlock(tile.worldPosition, state.setValue(BlockStateProperties.LIT, changeTo), Block.UPDATE_ALL);
|
||||
level.setBlock(pos, state.setValue(BlockStateProperties.LIT, changeTo), Block.UPDATE_ALL);
|
||||
}
|
||||
|
||||
tile.lastSmelted = smelted;
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
"block.actuallyadditions.feeder": "Automatic Feeder (wip)",
|
||||
"block.actuallyadditions.crusher": "Crusher (wip)",
|
||||
"block.actuallyadditions.crusher_double": "Double Crusher (wip)",
|
||||
"block.actuallyadditions.powered_furnace": "Powered Furnace (wip)",
|
||||
"block.actuallyadditions.powered_furnace": "Powered Furnace",
|
||||
"block.actuallyadditions.fishing_net": "Fishing Net (wip)",
|
||||
"block.actuallyadditions.heat_collector": "Heat Collector (wip)",
|
||||
"block.actuallyadditions.item_repairer": "Item Repairer (wip)",
|
||||
|
@ -168,7 +168,7 @@
|
|||
"block.actuallyadditions.dropper": "Automatic Precision Dropper",
|
||||
"block.actuallyadditions.ender_casing": "Ender Casing",
|
||||
"block.actuallyadditions.flax": "Flax Plant",
|
||||
"block.actuallyadditions.coffee_machine": "Coffee Maker (wip)",
|
||||
"block.actuallyadditions.coffee_machine": "Coffee Maker",
|
||||
"block.actuallyadditions.xp_solidifier": "Experience Solidifier (wip)",
|
||||
"block.actuallyadditions.leaf_generator": "Leaf-Eating Generator (wip)",
|
||||
"block.actuallyadditions.long_range_breaker": "Long-Range Breaker (wip)",
|
||||
|
@ -301,7 +301,7 @@
|
|||
"item.actuallyadditions.netherite_aiot": "Netherite AIOT (wip)",
|
||||
"item.actuallyadditions.phantom_connector": "Phantom Connector (wip)",
|
||||
"item.actuallyadditions.empty_cup": "Empty Cup",
|
||||
"item.actuallyadditions.coffee_cup": "Cup with Coffee (wip)",
|
||||
"item.actuallyadditions.coffee_cup": "Cup with Coffee",
|
||||
"item.actuallyadditions.coffee_seeds": "Coffee Seeds",
|
||||
"item.actuallyadditions.coffee_beans": "Coffee Beans (wip)",
|
||||
"item.actuallyadditions.canola_seeds": "Canola Seeds",
|
||||
|
|
Loading…
Reference in a new issue