File tree Expand file tree Collapse file tree 1 file changed +9
-8
lines changed
src/main/java/io/github/pylonmc/pylon/base/content/machines/smelting Expand file tree Collapse file tree 1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change @@ -134,16 +134,16 @@ public void onInteract(@NotNull PlayerInteractEvent event) {
134134 for (ItemStack contentItem : contents ) {
135135 currentAmount += contentItem .getAmount ();
136136 }
137- int taken = Math .min (CAPACITY - currentAmount , item .getAmount ());
138- if (taken <= 0 ) return ;
137+ if (currentAmount >= CAPACITY ) return ;
139138
139+ item .subtract ();
140140 for (ItemStack contentItem : contents ) {
141141 if (contentItem .isSimilar (item )) {
142- contentItem .add (taken );
143- break ;
142+ contentItem .add ();
143+ return ;
144144 }
145145 }
146- item .subtract ( taken );
146+ contents . add ( item .asOne () );
147147 }
148148
149149 @ Override
@@ -174,15 +174,16 @@ public void tick(double deltaSeconds) {
174174 };
175175 topBlock .setType (Material .COARSE_DIRT );
176176 }
177+ outputLoop :
177178 for (ItemStack outputItem : processing ) {
178179 int addAmount = (int ) Math .floor (outputItem .getAmount () * multiplier );
179180 for (ItemStack contentItem : contents ) {
180181 if (contentItem .isSimilar (outputItem )) {
181- outputItem .add (addAmount );
182- contents .remove (contentItem );
183- break ;
182+ contentItem .add (addAmount );
183+ continue outputLoop ;
184184 }
185185 }
186+ contents .add (outputItem .asQuantity (addAmount ));
186187 }
187188 processing .clear ();
188189 for (Vector3i coal : COAL_POSITIONS ) {
You can’t perform that action at this time.
0 commit comments