mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-03 19:06:27 +01:00
Merge branch 'mc1.15/dev' of https://github.com/Creators-of-Create/Create.git into mc1.15/dev
This commit is contained in:
commit
d702784293
12 changed files with 50 additions and 18 deletions
|
@ -101,9 +101,10 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
|
||||||
if (input)
|
if (input)
|
||||||
return;
|
return;
|
||||||
ProcessingOutput output = results.get(slotIndex - 1);
|
ProcessingOutput output = results.get(slotIndex - 1);
|
||||||
if (output.getChance() != 1)
|
float chance = output.getChance();
|
||||||
|
if (chance != 1)
|
||||||
tooltip.add(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)));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ import net.minecraft.item.Items;
|
||||||
public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe> {
|
public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe> {
|
||||||
|
|
||||||
public FanWashingCategory() {
|
public FanWashingCategory() {
|
||||||
super(doubleItemIcon(AllItems.PROPELLER.get(), Items.WATER_BUCKET));
|
super(185, doubleItemIcon(AllItems.PROPELLER.get(), Items.WATER_BUCKET));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,18 +37,19 @@ public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe
|
||||||
@Override
|
@Override
|
||||||
public void setRecipe(IRecipeLayout recipeLayout, SplashingRecipe recipe, IIngredients ingredients) {
|
public void setRecipe(IRecipeLayout recipeLayout, SplashingRecipe recipe, IIngredients ingredients) {
|
||||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||||
itemStacks.init(0, true, 20, 47);
|
itemStacks.init(0, true, 12, 47);
|
||||||
itemStacks.set(0, Arrays.asList(recipe.getIngredients()
|
itemStacks.set(0, Arrays.asList(recipe.getIngredients()
|
||||||
.get(0)
|
.get(0)
|
||||||
.getMatchingStacks()));
|
.getMatchingStacks()));
|
||||||
|
|
||||||
List<ProcessingOutput> results = recipe.getRollableResults();
|
List<ProcessingOutput> results = recipe.getRollableResults();
|
||||||
boolean single = results.size() == 1;
|
boolean single = results.size() == 1;
|
||||||
|
boolean excessive = results.size() > 9;
|
||||||
for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) {
|
for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) {
|
||||||
int xOffset = outputIndex % 2 == 0 ? 0 : 19;
|
int xOffset = (outputIndex % 3) * 19;
|
||||||
int yOffset = (outputIndex / 2) * -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)
|
itemStacks.set(outputIndex + 1, results.get(outputIndex)
|
||||||
.getStack());
|
.getStack());
|
||||||
}
|
}
|
||||||
|
@ -61,22 +62,27 @@ public class FanWashingCategory extends ProcessingViaFanCategory<SplashingRecipe
|
||||||
int size = recipe.getRollableResultsAsItemStacks()
|
int size = recipe.getRollableResultsAsItemStacks()
|
||||||
.size();
|
.size();
|
||||||
|
|
||||||
AllGuiTextures.JEI_SLOT.draw(20, 47);
|
AllGuiTextures.JEI_SLOT.draw(12, 47);
|
||||||
AllGuiTextures.JEI_SHADOW.draw(47, 29);
|
AllGuiTextures.JEI_SHADOW.draw(39, 29);
|
||||||
AllGuiTextures.JEI_SHADOW.draw(66, 39);
|
AllGuiTextures.JEI_SHADOW.draw(54, 39);
|
||||||
AllGuiTextures.JEI_LONG_ARROW.draw(53, 51);
|
AllGuiTextures.JEI_LONG_ARROW.draw(42, 51);
|
||||||
|
|
||||||
if (size == 1) {
|
if (size == 1) {
|
||||||
getRenderedSlot(recipe, 0).draw(139, 47);
|
getRenderedSlot(recipe, 0).draw(126, 47);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < size; i++) {
|
for (int i = 0; i < size; i++) {
|
||||||
int xOffset = i % 2 == 0 ? 0 : 19;
|
int xOffset = (i % 3) * 19;
|
||||||
int yOffset = (i / 2) * -19;
|
int yOffset = (i / 3) * -19 + (size > 9 ? 8 : 0);
|
||||||
getRenderedSlot(recipe, i).draw(133 + xOffset, 47 + yOffset);
|
getRenderedSlot(recipe, i).draw(121 + xOffset, 47 + yOffset);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void translateFan() {
|
||||||
|
RenderSystem.translatef(43, 33, 0);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderAttachedBlock() {
|
public void renderAttachedBlock() {
|
||||||
|
|
|
@ -24,7 +24,11 @@ import net.minecraft.util.text.TextFormatting;
|
||||||
public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends CreateRecipeCategory<T> {
|
public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends CreateRecipeCategory<T> {
|
||||||
|
|
||||||
public ProcessingViaFanCategory(IDrawable icon) {
|
public ProcessingViaFanCategory(IDrawable icon) {
|
||||||
super(icon, emptyBackground(177, 70));
|
this(177, icon);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected ProcessingViaFanCategory(int width, IDrawable icon) {
|
||||||
|
super(icon, emptyBackground(width, 71));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -62,7 +66,7 @@ public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends Cre
|
||||||
public void draw(T recipe, double mouseX, double mouseY) {
|
public void draw(T recipe, double mouseX, double mouseY) {
|
||||||
renderWidgets(recipe, mouseX, mouseY);
|
renderWidgets(recipe, mouseX, mouseY);
|
||||||
RenderSystem.pushMatrix();
|
RenderSystem.pushMatrix();
|
||||||
RenderSystem.translatef(56, 33, 0);
|
translateFan();
|
||||||
RenderSystem.rotatef(-12.5f, 1, 0, 0);
|
RenderSystem.rotatef(-12.5f, 1, 0, 0);
|
||||||
RenderSystem.rotatef(22.5f, 0, 1, 0);
|
RenderSystem.rotatef(22.5f, 0, 1, 0);
|
||||||
int scale = 24;
|
int scale = 24;
|
||||||
|
@ -82,6 +86,10 @@ public abstract class ProcessingViaFanCategory<T extends IRecipe<?>> extends Cre
|
||||||
RenderSystem.popMatrix();
|
RenderSystem.popMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void translateFan() {
|
||||||
|
RenderSystem.translatef(56, 33, 0);
|
||||||
|
}
|
||||||
|
|
||||||
public abstract void renderAttachedBlock();
|
public abstract void renderAttachedBlock();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class SplashingRecipe extends ProcessingRecipe<InWorldProcessing.Splashin
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected int getMaxOutputCount() {
|
protected int getMaxOutputCount() {
|
||||||
return 6;
|
return 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -93,6 +93,8 @@ public class MillstoneBlock extends KineticBlock implements ITE<MillstoneTileEnt
|
||||||
return;
|
return;
|
||||||
if (!(entityIn instanceof ItemEntity))
|
if (!(entityIn instanceof ItemEntity))
|
||||||
return;
|
return;
|
||||||
|
if (!entityIn.isAlive())
|
||||||
|
return;
|
||||||
|
|
||||||
MillstoneTileEntity millstone = null;
|
MillstoneTileEntity millstone = null;
|
||||||
for (BlockPos pos : Iterate.hereAndBelow(entityIn.getPosition())) {
|
for (BlockPos pos : Iterate.hereAndBelow(entityIn.getPosition())) {
|
||||||
|
|
|
@ -233,6 +233,8 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
|
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
|
||||||
if (!(entity instanceof ItemEntity))
|
if (!(entity instanceof ItemEntity))
|
||||||
continue;
|
continue;
|
||||||
|
if (!entity.isAlive())
|
||||||
|
continue;
|
||||||
ItemEntity itemEntity = (ItemEntity) entity;
|
ItemEntity itemEntity = (ItemEntity) entity;
|
||||||
pressedItems.add(itemEntity.getItem());
|
pressedItems.add(itemEntity.getItem());
|
||||||
sendData();
|
sendData();
|
||||||
|
|
|
@ -281,6 +281,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
return;
|
return;
|
||||||
if (!inventory.isEmpty())
|
if (!inventory.isEmpty())
|
||||||
return;
|
return;
|
||||||
|
if (!entity.isAlive())
|
||||||
|
return;
|
||||||
if (world.isRemote)
|
if (world.isRemote)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -168,6 +168,8 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||||
return;
|
return;
|
||||||
if (entityIn.getMotion().y > 0)
|
if (entityIn.getMotion().y > 0)
|
||||||
return;
|
return;
|
||||||
|
if (!entityIn.isAlive())
|
||||||
|
return;
|
||||||
withTileEntityDo(worldIn, pos, te -> {
|
withTileEntityDo(worldIn, pos, te -> {
|
||||||
ItemEntity itemEntity = (ItemEntity) entityIn;
|
ItemEntity itemEntity = (ItemEntity) entityIn;
|
||||||
IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
|
IItemHandler handler = te.getCapability(CapabilityItemHandler.ITEM_HANDLER_CAPABILITY)
|
||||||
|
|
|
@ -79,6 +79,8 @@ public class ChuteBlock extends Block implements IWrenchable, ITE<ChuteTileEntit
|
||||||
return;
|
return;
|
||||||
if (entityIn.world.isRemote)
|
if (entityIn.world.isRemote)
|
||||||
return;
|
return;
|
||||||
|
if (!entityIn.isAlive())
|
||||||
|
return;
|
||||||
DirectBeltInputBehaviour input = TileEntityBehaviour.get(entityIn.world, new BlockPos(entityIn.getPositionVec()
|
DirectBeltInputBehaviour input = TileEntityBehaviour.get(entityIn.world, new BlockPos(entityIn.getPositionVec()
|
||||||
.add(0, 0.5f, 0)).down(), DirectBeltInputBehaviour.TYPE);
|
.add(0, 0.5f, 0)).down(), DirectBeltInputBehaviour.TYPE);
|
||||||
if (input == null)
|
if (input == null)
|
||||||
|
|
|
@ -101,6 +101,8 @@ public abstract class FunnelBlock extends ProperDirectionalBlock implements ITE<
|
||||||
return;
|
return;
|
||||||
if (!canInsertIntoFunnel(state))
|
if (!canInsertIntoFunnel(state))
|
||||||
return;
|
return;
|
||||||
|
if (!entityIn.isAlive())
|
||||||
|
return;
|
||||||
ItemEntity itemEntity = (ItemEntity) entityIn;
|
ItemEntity itemEntity = (ItemEntity) entityIn;
|
||||||
|
|
||||||
Direction direction = state.get(FACING);
|
Direction direction = state.get(FACING);
|
||||||
|
|
|
@ -45,6 +45,8 @@ public class FunnelMovementBehaviour extends MovementBehaviour {
|
||||||
ItemStack filter = getFilter(context);
|
ItemStack filter = getFilter(context);
|
||||||
|
|
||||||
for (ItemEntity item : items) {
|
for (ItemEntity item : items) {
|
||||||
|
if (!item.isAlive())
|
||||||
|
continue;
|
||||||
ItemStack toInsert = item.getItem();
|
ItemStack toInsert = item.getItem();
|
||||||
if (!filter.isEmpty() && !FilterItem.test(context.world, toInsert, filter))
|
if (!filter.isEmpty() && !FilterItem.test(context.world, toInsert, filter))
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -36,6 +36,9 @@ public class BottomlessItemHandler extends ItemStackHandler {
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setStackInSlot(int slot, ItemStack stack) {}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
|
public ItemStack insertItem(int slot, ItemStack stack, boolean simulate) {
|
||||||
return ItemStack.EMPTY;
|
return ItemStack.EMPTY;
|
||||||
|
|
Loading…
Reference in a new issue