Merge branch 'mc1.15/dev' of https://github.com/Creators-of-Create/Create.git into mc1.15/dev

This commit is contained in:
garyantonyo 2021-01-01 22:51:56 -05:00
commit d702784293
12 changed files with 50 additions and 18 deletions

View file

@ -101,9 +101,10 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
if (input)
return;
ProcessingOutput output = results.get(slotIndex - 1);
if (output.getChance() != 1)
float chance = output.getChance();
if (chance != 1)
tooltip.add(1,
TextFormatting.GOLD + Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100)));
TextFormatting.GOLD + Lang.translate("recipe.processing.chance", chance < 0.01 ? "<1" : (int) (chance * 100)));
});
}

View file

@ -20,7 +20,7 @@ import net.minecraft.item.Items;
public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe> {
public FanWashingCategory() {
super(doubleItemIcon(AllItems.PROPELLER.get(), Items.WATER_BUCKET));
super(185, doubleItemIcon(AllItems.PROPELLER.get(), Items.WATER_BUCKET));
}
@Override
@ -37,18 +37,19 @@ public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe
@Override
public void setRecipe(IRecipeLayout recipeLayout, SplashingRecipe recipe, IIngredients ingredients) {
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
itemStacks.init(0, true, 20, 47);
itemStacks.init(0, true, 12, 47);
itemStacks.set(0, Arrays.asList(recipe.getIngredients()
.get(0)
.getMatchingStacks()));
List<ProcessingOutput> results = recipe.getRollableResults();
boolean single = results.size() == 1;
boolean excessive = results.size() > 9;
for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) {
int xOffset = outputIndex % 2 == 0 ? 0 : 19;
int yOffset = (outputIndex / 2) * -19;
int xOffset = (outputIndex % 3) * 19;
int yOffset = (outputIndex / 3) * -19;
itemStacks.init(outputIndex + 1, false, single ? 139 : 133 + xOffset, 47 + yOffset);
itemStacks.init(outputIndex + 1, false, single ? 126 : 121 + xOffset, 47 + yOffset + (excessive ? 8 : 0));
itemStacks.set(outputIndex + 1, results.get(outputIndex)
.getStack());
}
@ -61,22 +62,27 @@ public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe
int size = recipe.getRollableResultsAsItemStacks()
.size();
AllGuiTextures.JEI_SLOT.draw(20, 47);
AllGuiTextures.JEI_SHADOW.draw(47, 29);
AllGuiTextures.JEI_SHADOW.draw(66, 39);
AllGuiTextures.JEI_LONG_ARROW.draw(53, 51);
AllGuiTextures.JEI_SLOT.draw(12, 47);
AllGuiTextures.JEI_SHADOW.draw(39, 29);
AllGuiTextures.JEI_SHADOW.draw(54, 39);
AllGuiTextures.JEI_LONG_ARROW.draw(42, 51);
if (size == 1) {
getRenderedSlot(recipe, 0).draw(139, 47);
getRenderedSlot(recipe, 0).draw(126, 47);
return;
}
for (int i = 0; i < size; i++) {
int xOffset = i % 2 == 0 ? 0 : 19;
int yOffset = (i / 2) * -19;
getRenderedSlot(recipe, i).draw(133 + xOffset, 47 + yOffset);
int xOffset = (i % 3) * 19;
int yOffset = (i / 3) * -19 + (size > 9 ? 8 : 0);
getRenderedSlot(recipe, i).draw(121 + xOffset, 47 + yOffset);
}
}
@Override
protected void translateFan() {
RenderSystem.translatef(43, 33, 0);
}
@Override
public void renderAttachedBlock() {

View file

@ -24,7 +24,11 @@ import net.minecraft.util.text.TextFormatting;
public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends CreateRecipeCategory<T> {
public ProcessingViaFanCategory(IDrawable icon) {
super(icon, emptyBackground(177, 70));
this(177, icon);
}
protected ProcessingViaFanCategory(int width, IDrawable icon) {
super(icon, emptyBackground(width, 71));
}
@Override
@ -62,7 +66,7 @@ public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends Cre
public void draw(T recipe, double mouseX, double mouseY) {
renderWidgets(recipe, mouseX, mouseY);
RenderSystem.pushMatrix();
RenderSystem.translatef(56, 33, 0);
translateFan();
RenderSystem.rotatef(-12.5f, 1, 0, 0);
RenderSystem.rotatef(22.5f, 0, 1, 0);
int scale = 24;
@ -82,6 +86,10 @@ public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends Cre
RenderSystem.popMatrix();
}
protected void translateFan() {
RenderSystem.translatef(56, 33, 0);
}
public abstract void renderAttachedBlock();
}

View file

@ -32,7 +32,7 @@ public class SplashingRecipe extends ProcessingRecipe<InWorldProcessing.Splashin
@Override
protected int getMaxOutputCount() {
return 6;
return 12;
}
}

View file

@ -93,6 +93,8 @@ public class MillstoneBlock extends KineticBlock implements ITE<MillstoneTileEnt
return;
if (!(entityIn instanceof ItemEntity))
return;
if (!entityIn.isAlive())
return;
MillstoneTileEntity millstone = null;
for (BlockPos pos : Iterate.hereAndBelow(entityIn.getPosition())) {

View file

@ -233,6 +233,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
if (!(entity instanceof ItemEntity))
continue;
if (!entity.isAlive())
continue;
ItemEntity itemEntity = (ItemEntity) entity;
pressedItems.add(itemEntity.getItem());
sendData();

View file

@ -281,6 +281,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
return;
if (!inventory.isEmpty())
return;
if (!entity.isAlive())
return;
if (world.isRemote)
return;

View file

@ -168,6 +168,8 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
return;
if (entityIn.getMotion().y > 0)
return;
if (!entityIn.isAlive())
return;
withTileEntityDo(worldIn, pos, te -> {
ItemEntity itemEntity = (ItemEntity) entityIn;
IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)

View file

@ -79,6 +79,8 @@ public class ChuteBlock extends Block implements IWrenchable, ITE<ChuteTileEntit
return;
if (entityIn.world.isRemote)
return;
if (!entityIn.isAlive())
return;
DirectBeltInputBehaviour input = TileEntityBehaviour.get(entityIn.world, new BlockPos(entityIn.getPositionVec()
.add(0, 0.5f, 0)).down(), DirectBeltInputBehaviour.TYPE);
if (input == null)

View file

@ -101,6 +101,8 @@ public abstract class FunnelBlock extends ProperDirectionalBlock implements ITE<
return;
if (!canInsertIntoFunnel(state))
return;
if (!entityIn.isAlive())
return;
ItemEntity itemEntity = (ItemEntity) entityIn;
Direction direction = state.get(FACING);

View file

@ -45,6 +45,8 @@ public class FunnelMovementBehaviour extends MovementBehaviour {
ItemStack filter = getFilter(context);
for (ItemEntity item : items) {
if (!item.isAlive())
continue;
ItemStack toInsert = item.getItem();
if (!filter.isEmpty() && !FilterItem.test(context.world, toInsert, filter))
continue;

View file

@ -36,6 +36,9 @@ public class BottomlessItemHandler extends ItemStackHandler {
return stack;
}
@Override
public void setStackInSlot(int slot, ItemStack stack) {}
@Override
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
return ItemStack.EMPTY;