Add Crafter #99

Merged
dphaldes merged 16 commits from dev/crafter into dev/1.19.x 2023-01-31 08:42:16 +00:00
dphaldes commented 2022-12-05 17:43:13 +00:00 (Migrated from github.com)

Description

Add Crafter

Todo

  • GUI
  • actual block functions
  • Redstone
  • Block model
  • IO config
  • Switch to task
  • Testing
  • switch to slotaccess #101

Checklist:

  • My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
# Description Add Crafter # Todo - [x] GUI - [x] actual block functions - [x] Redstone - [x] Block model - [ ] ~~IO config~~ - [ ] Switch to task - [x] Testing - [x] switch to slotaccess #101 # Checklist: - [x] My code follows the style guidelines of this project (.editorconfig, most IDEs will use this for you) - [x] I have performed a self-review of my own code - [x] I have commented my code, particularly in hard-to-understand areas - [x] I have made corresponding changes to the documentation <!-- Thanks to: https://embeddedartistry.com/blog/2017/08/04/a-github-pull-request-template-for-your-projects/ for the building blocks of this template -->
justliliandev (Migrated from github.com) requested changes 2022-12-29 13:42:02 +00:00
@ -0,0 +1,177 @@
package com.enderio.machines.common.blockentity;
justliliandev (Migrated from github.com) commented 2022-12-29 10:51:20 +00:00

don't use a NonNullLIst, rather code this against the queue interface with an ArrayDeque as impl

don't use a NonNullLIst, rather code this against the queue interface with an ArrayDeque as impl
justliliandev (Migrated from github.com) commented 2022-12-29 11:03:46 +00:00

extract this to a tryCraftItem method

extract this to a tryCraftItem method
justliliandev (Migrated from github.com) commented 2022-12-29 11:07:25 +00:00

make sure that no empty stack is added to the deque instead of removing all empty itemstacks each tick

make sure that no empty stack is added to the deque instead of removing all empty itemstacks each tick
justliliandev (Migrated from github.com) commented 2022-12-29 13:35:10 +00:00

do this check by calling ItemStack#isSameItemSameTags

do this check by calling ItemStack#isSameItemSameTags
justliliandev (Migrated from github.com) commented 2022-12-29 13:36:08 +00:00

just use else, because the canMergeOutput does this check implicitly
also grow by the size of the outputbuffer itemstack

just use else, because the canMergeOutput does this check implicitly also grow by the size of the outputbuffer itemstack
justliliandev (Migrated from github.com) commented 2022-12-29 13:37:01 +00:00

nope, not necessary

nope, not necessary
@ -0,0 +88,4 @@
public void serverTick() {
tryCraft();
super.serverTick();
processOutputBuffer();
justliliandev (Migrated from github.com) commented 2022-12-29 11:01:48 +00:00

move processOutputBuffer call to after the super.serverTick to push something into the outputslot directly after the machine has pushed it's content

move processOutputBuffer call to after the super.serverTick to push something into the outputslot directly after the machine has pushed it's content
@ -291,7 +291,7 @@ public class MachineInventoryLayout {
}
/**
justliliandev (Migrated from github.com) commented 2022-12-29 13:39:33 +00:00

fix javadoc to imply multiple slots

fix javadoc to imply multiple slots
dphaldes (Migrated from github.com) reviewed 2023-01-06 12:49:53 +00:00
@ -0,0 +1,177 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-01-06 12:49:53 +00:00

Just change sameItem() to isSameItemSameTags() ?

Just change `sameItem()` to `isSameItemSameTags()` ?
justliliandev (Migrated from github.com) reviewed 2023-01-06 13:01:01 +00:00
@ -0,0 +1,177 @@
package com.enderio.machines.common.blockentity;
justliliandev (Migrated from github.com) commented 2023-01-06 13:01:01 +00:00

Yep

Yep
dphaldes (Migrated from github.com) reviewed 2023-01-06 13:06:56 +00:00
@ -291,7 +291,7 @@ public class MachineInventoryLayout {
}
/**
dphaldes (Migrated from github.com) commented 2023-01-06 13:06:55 +00:00

I don't understand. Can you reiterate ?

I don't understand. Can you reiterate ?
dphaldes (Migrated from github.com) reviewed 2023-01-06 13:08:17 +00:00
@ -0,0 +88,4 @@
public void serverTick() {
tryCraft();
super.serverTick();
processOutputBuffer();
dphaldes (Migrated from github.com) commented 2023-01-06 13:08:15 +00:00

I have moved this down. Is it fine now ?

I have moved this down. Is it fine now ?
justliliandev (Migrated from github.com) reviewed 2023-01-06 13:12:17 +00:00
@ -291,7 +291,7 @@ public class MachineInventoryLayout {
}
/**
justliliandev (Migrated from github.com) commented 2023-01-06 13:12:03 +00:00

Some of the builder methods have javadoc that says adds a ghost slot (so singular) while having an int parameter for the amount of fields. Change the javadoc of those methods to plural

Some of the builder methods have javadoc that says adds a ghost slot (so singular) while having an int parameter for the amount of fields. Change the javadoc of those methods to plural
dphaldes (Migrated from github.com) reviewed 2023-01-06 13:20:05 +00:00
@ -291,7 +291,7 @@ public class MachineInventoryLayout {
}
/**
dphaldes (Migrated from github.com) commented 2023-01-06 13:20:04 +00:00

Understood. input and output slots have them. Storage and ghost don't. Should I change them as well ?

Understood. input and output slots have them. Storage and ghost don't. Should I change them as well ?
justliliandev (Migrated from github.com) reviewed 2023-01-06 13:22:16 +00:00
@ -291,7 +291,7 @@ public class MachineInventoryLayout {
}
/**
justliliandev (Migrated from github.com) commented 2023-01-06 13:22:16 +00:00

Yeah, all things that allow multipls slots should be written in plural

Yeah, all things that allow multipls slots should be written in plural
dphaldes (Migrated from github.com) reviewed 2023-01-06 14:38:09 +00:00
@ -0,0 +1,177 @@
package com.enderio.machines.common.blockentity;
dphaldes (Migrated from github.com) commented 2023-01-06 14:38:09 +00:00

I have changed the type. The old method calls seem to work fine (changed the required ones). Let me know if I need to make more changes

I have changed the type. The old method calls seem to work fine (changed the required ones). Let me know if I need to make more changes
justliliandev (Migrated from github.com) approved these changes 2023-01-07 15:29:05 +00:00
justliliandev (Migrated from github.com) left a comment

codewise this looks good, will do some ingame check next

codewise this looks good, will do some ingame check next
justliliandev commented 2023-01-07 15:56:50 +00:00 (Migrated from github.com)

do you want to wait for slotaccess to be merged into and rebase your stuff onto it or should we merge this and I'll change the crafter to use slot access

do you want to wait for slotaccess to be merged into and rebase your stuff onto it or should we merge this and I'll change the crafter to use slot access
dphaldes commented 2023-01-07 18:18:36 +00:00 (Migrated from github.com)

This PR is not ready to be merged as of now (I have few todos on the top. ) Also I will like to wait for slotaccess and hopefully IO config as well

This PR is not ready to be merged as of now (I have few todos on the top. ) Also I will like to wait for slotaccess and hopefully IO config as well
justliliandev (Migrated from github.com) approved these changes 2023-01-31 08:42:04 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: Team-EnderIO/EnderIO#99
No description provided.