Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting the work on farming station #463

Closed
Closed
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "enderio:block/farming_station_combined",
"y": 90
},
"facing=north": {
"model": "enderio:block/farming_station_combined"
},
"facing=south": {
"model": "enderio:block/farming_station_combined",
"y": 180
},
"facing=west": {
"model": "enderio:block/farming_station_combined",
"y": 270
}
}
}
1 change: 1 addition & 0 deletions src/generated/resources/assets/enderio/lang/en_ud.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"block.enderio.energetic_alloy_block": "ʞɔoןᗺ ʎoןןⱯ ɔıʇǝbɹǝuƎ",
"block.enderio.energetic_photovoltaic_module": "ǝןnpoW ɔıɐʇןoʌoʇoɥԀ ɔıʇǝbɹǝuƎ",
"block.enderio.ensouled_chassis": "sıssɐɥƆ pǝןnosuƎ",
"block.enderio.farming_station": "uoıʇɐʇS buıɯɹɐℲ",
"block.enderio.fire_water": "ɹǝʇɐM ǝɹıℲ",
"block.enderio.fluid_tank": "ʞuɐ⟘ pınןℲ",
"block.enderio.fused_quartz": "zʇɹɐnὉ pǝsnℲ",
Expand Down
1 change: 1 addition & 0 deletions src/generated/resources/assets/enderio/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
"block.enderio.energetic_alloy_block": "Energetic Alloy Block",
"block.enderio.energetic_photovoltaic_module": "Energetic Photovoltaic Module",
"block.enderio.ensouled_chassis": "Ensouled Chassis",
"block.enderio.farming_station": "Farming Station",
"block.enderio.fire_water": "Fire Water",
"block.enderio.fluid_tank": "Fluid Tank",
"block.enderio.fused_quartz": "Fused Quartz",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"parent": "minecraft:block/block",
"children": {
"machine": {
"parent": "enderio:block/farming_station"
},
"overlay": {
"parent": "enderio:block/io_overlay"
}
},
"item_render_order": [
"machine",
"overlay"
],
"loader": "forge:composite"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"parent": "enderio:block/farming_station",
"textures": {
"particle": "enderio:block/farming_station"
},
"display": {
"gui": {
"rotation": [ 30, 45, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.625, 0.625, 0.625 ]
},
"ground": {
"rotation": [ 0, 0, 0 ],
"translation": [ 0, 3, 0],
"scale":[ 0.25, 0.25, 0.25 ]
},
"head": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 1, 1, 1]
},
"fixed": {
"rotation": [ 0, 180, 0 ],
"translation": [ 0, 0, 0],
"scale":[ 0.5, 0.5, 0.5 ]
},
"thirdperson_righthand": {
"rotation": [ 75, 315, 0 ],
"translation": [ 0, 2.5, 0],
"scale": [ 0.375, 0.375, 0.375 ]
},
"firstperson_righthand": {
"rotation": [ 0, 315, 0 ],
"translation": [ 0, 0, 0],
"scale": [ 0.4, 0.4, 0.4 ]
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"type": "minecraft:block",
"pools": [
{
"bonus_rolls": 0.0,
"entries": [
{
"type": "minecraft:item",
"functions": [
{
"function": "minecraft:copy_nbt",
"ops": [
{
"op": "replace",
"source": "",
"target": "BlockEntityTag"
}
],
"source": "block_entity"
}
],
"name": "enderio:farming_station"
}
],
"rolls": 1.0
}
],
"random_sequence": "enderio:blocks/farming_station"
}
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
"enderio:slice_and_splice",
"enderio:impulse_hopper",
"enderio:soul_binder",
"enderio:farming_station",
"enderio:powered_spawner",
"enderio:vacuum_chest",
"enderio:xp_vacuum",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
"enderio:slice_and_splice",
"enderio:impulse_hopper",
"enderio:soul_binder",
"enderio:farming_station",
"enderio:powered_spawner",
"enderio:vacuum_chest",
"enderio:xp_vacuum",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.enderio.machines.client.gui.screen;

import com.enderio.EnderIO;
import com.enderio.api.misc.Vector2i;
import com.enderio.base.common.lang.EIOLang;
import com.enderio.core.client.gui.screen.EIOScreen;
import com.enderio.core.client.gui.widgets.EnumIconWidget;
import com.enderio.core.client.gui.widgets.ToggleImageButton;
import com.enderio.machines.client.gui.widget.CapacitorEnergyWidget;
import com.enderio.machines.client.gui.widget.FluidStackWidget;
import com.enderio.machines.client.gui.widget.ProgressWidget;
import com.enderio.machines.client.gui.widget.ioconfig.IOConfigButton;
import com.enderio.machines.common.menu.FarmingStationMenu;
import com.enderio.machines.common.menu.WiredChargerMenu;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.player.Inventory;

public class FarmingStationScreen extends EIOScreen<FarmingStationMenu> {

private static final ResourceLocation BG_TEXTURE = EnderIO.loc("textures/gui/farming_station.png");
private static final ResourceLocation RANGE_BUTTON_TEXTURE = EnderIO.loc("textures/gui/icons/range_buttons.png");
public FarmingStationScreen(FarmingStationMenu pMenu, Inventory pPlayerInventory, Component pTitle) {
super(pMenu, pPlayerInventory, pTitle);
}

@Override
protected void init() {
super.init();

addRenderableOnly(new CapacitorEnergyWidget(this, getMenu().getBlockEntity()::getEnergyStorage, getMenu().getBlockEntity()::isCapacitorInstalled, 16 + leftPos + 42, 14 + topPos, 9, 45));

addRenderableWidget(new EnumIconWidget<>(this, leftPos + imageWidth - 8 - 12, topPos + 6, () -> menu.getBlockEntity().getRedstoneControl(),
control -> menu.getBlockEntity().setRedstoneControl(control), EIOLang.REDSTONE_MODE));

addRenderableWidget(new IOConfigButton<>(this, leftPos + imageWidth - 6 - 16, topPos + 22, 16, 16, menu, this::addRenderableWidget, font));


addRenderableWidget(new ToggleImageButton<>(this, leftPos + imageWidth - 6 - 16, topPos + 40, 16, 16, 0, 0, 16, 0, RANGE_BUTTON_TEXTURE,
() -> menu.getBlockEntity().isRangeVisible(), state -> menu.getBlockEntity().setIsRangeVisible(state),
() -> menu.getBlockEntity().isRangeVisible() ? EIOLang.HIDE_RANGE : EIOLang.SHOW_RANGE));

addRenderableOnly(new FluidStackWidget(this, getMenu().getBlockEntity()::getFluidTank, 7 + leftPos, 14 + topPos, 16, 47));
}

@Override
public ResourceLocation getBackgroundImage() {
return BG_TEXTURE;
}

@Override
protected Vector2i getBackgroundImageSize() {
return new Vector2i(227, 169);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ public int getRange() {
public void setRange(int range) {
if (level != null && level.isClientSide()) {
clientUpdateSlot(rangeDataSlot, range);
this.range = range;
} else this.range = range;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package com.enderio.machines.common.blockentity.farming;

public enum FarmingOperation {
TILL,
PLANT,
CHOP,
MISC
}
Loading