-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- update to latest ae2 version
- Loading branch information
Showing
12 changed files
with
94 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 24 additions & 19 deletions
43
src/main/java/io/github/projectet/ae2things/block/entity/BECrystalGrowth.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,46 +1,51 @@ | ||
package io.github.projectet.ae2things.block.entity; | ||
|
||
import appeng.api.inventories.InternalInventory; | ||
import appeng.api.networking.IGridNode; | ||
import appeng.api.networking.ticking.IGridTickable; | ||
import appeng.api.networking.ticking.TickRateModulation; | ||
import appeng.api.networking.ticking.TickingRequest; | ||
import appeng.api.upgrades.IUpgradeInventory; | ||
import appeng.api.upgrades.IUpgradeableObject; | ||
import appeng.api.upgrades.UpgradeInventories; | ||
import appeng.blockentity.grid.AENetworkPowerBlockEntity; | ||
import appeng.util.inv.AppEngInternalInventory; | ||
import io.github.projectet.ae2things.AE2Things; | ||
import io.github.projectet.ae2things.inventory.DefaultInventory; | ||
import net.minecraft.block.BlockState; | ||
import net.minecraft.block.entity.BlockEntity; | ||
import net.minecraft.inventory.SidedInventory; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.util.collection.DefaultedList; | ||
import net.minecraft.util.math.BlockPos; | ||
import net.minecraft.util.math.Direction; | ||
import net.minecraft.world.World; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
public class BECrystalGrowth extends BlockEntity implements DefaultInventory, SidedInventory { | ||
public class BECrystalGrowth extends AENetworkPowerBlockEntity implements IGridTickable, IUpgradeableObject { | ||
|
||
DefaultedList<ItemStack> inventory = DefaultedList.ofSize(30); | ||
private final AppEngInternalInventory inventory = new AppEngInternalInventory(this, 27); | ||
private IUpgradeInventory upgrades; | ||
|
||
public BECrystalGrowth(BlockPos pos, BlockState state) { | ||
super(AE2Things.CRYSTAL_GROWTH_BE, pos, state); | ||
upgrades = UpgradeInventories.forMachine(AE2Things.CRYSTAL_GROWTH, 3, this::saveChanges); | ||
} | ||
|
||
@Override | ||
public DefaultedList<ItemStack> getItems() { | ||
public TickingRequest getTickingRequest(IGridNode node) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public int[] getAvailableSlots(Direction side) { | ||
return new int[0]; | ||
public TickRateModulation tickingRequest(IGridNode node, int ticksSinceLastCall) { | ||
return null; | ||
} | ||
|
||
@Override | ||
public boolean canInsert(int slot, ItemStack stack, @Nullable Direction dir) { | ||
return false; | ||
public InternalInventory getInternalInventory() { | ||
return inventory; | ||
} | ||
|
||
@Override | ||
public boolean canExtract(int slot, ItemStack stack, Direction dir) { | ||
return false; | ||
} | ||
public void onChangeInventory(InternalInventory inv, int slot) { | ||
|
||
public static void tick(World world, BlockPos pos, BlockState state, BECrystalGrowth blockEntity) { | ||
} | ||
|
||
@Override | ||
public IUpgradeInventory getUpgrades() { | ||
return upgrades; | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/main/java/io/github/projectet/ae2things/command/Command.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
package io.github.projectet.ae2things.command; | ||
|
||
public class Command { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 13 additions & 1 deletion
14
src/main/java/io/github/projectet/ae2things/gui/crystalGrowth/CrystalGrowthMenu.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
package io.github.projectet.ae2things.gui.crystalGrowth; | ||
|
||
public class CrystalGrowthMenu { | ||
import appeng.menu.implementations.MenuTypeBuilder; | ||
import appeng.menu.implementations.UpgradeableMenu; | ||
import io.github.projectet.ae2things.block.entity.BECrystalGrowth; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.screen.ScreenHandlerType; | ||
|
||
public class CrystalGrowthMenu extends UpgradeableMenu<BECrystalGrowth> { | ||
|
||
public static ScreenHandlerType<CrystalGrowthMenu> CRYSTAL_GROWTH_SHT = MenuTypeBuilder.create(CrystalGrowthMenu::new, BECrystalGrowth.class).build("crystal_growth"); | ||
|
||
public CrystalGrowthMenu(int id, PlayerInventory ip, BECrystalGrowth crystalGrowth) { | ||
super(CRYSTAL_GROWTH_SHT, id, ip, crystalGrowth); | ||
} | ||
} |
11 changes: 10 additions & 1 deletion
11
src/main/java/io/github/projectet/ae2things/gui/crystalGrowth/CrystalGrowthRootPanel.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,13 @@ | ||
package io.github.projectet.ae2things.gui.crystalGrowth; | ||
|
||
public class CrystalGrowthRootPanel { | ||
import appeng.client.gui.implementations.UpgradeableScreen; | ||
import appeng.client.gui.style.ScreenStyle; | ||
import net.minecraft.entity.player.PlayerInventory; | ||
import net.minecraft.text.Text; | ||
|
||
public class CrystalGrowthRootPanel extends UpgradeableScreen<CrystalGrowthMenu> { | ||
|
||
public CrystalGrowthRootPanel(CrystalGrowthMenu menu, PlayerInventory playerInventory, Text title, ScreenStyle style) { | ||
super(menu, playerInventory, title, style); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters