mirror of
https://github.com/Creators-of-Create/Create.git
synced 2025-01-23 11:28:10 +01:00
Bug Busting 0.1 Part I
- Washing recipes can now have stochastic outputs - Splashing fans no longer spam the extinguish sound - Mechanical Press now properly registers as a belt attachment - Improved animations for Mechanical Press - Fixed Pulse Repeaters staying powered under certain conditions - Fixed Belt observer state sync issues - Stopped Filters on tileentities from disappearing - Fixed Item count not showing on filtered Extractors - Fixed Filters not being properly handled by Extractors - Fixed Extractors no longer being redstone locked on world reload - Fixed Redstone Links being powered inconsistently - Added a few more processing recipes
This commit is contained in:
parent
fc82dc33d9
commit
5c8206030c
58 changed files with 957 additions and 135 deletions
|
@ -37,6 +37,7 @@ public enum ScreenResources {
|
|||
FAN_RECIPE("recipes1.png", 0, 128, 177, 109),
|
||||
BLOCKZAPPER_UPGRADE_RECIPE("recipes2.png", 144, 66),
|
||||
PRESSER_RECIPE("recipes2.png", 0, 108, 177, 109),
|
||||
WASHING_RECIPE("recipes3.png", 177, 109),
|
||||
|
||||
// Widgets
|
||||
PALETTE_BUTTON("palette_picker.png", 0, 236, 20, 20),
|
||||
|
|
|
@ -1,20 +1,29 @@
|
|||
package com.simibubi.create.compat.jei;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.simibubi.create.AllItems;
|
||||
import com.simibubi.create.Create;
|
||||
import com.simibubi.create.ScreenResources;
|
||||
import com.simibubi.create.foundation.gui.ScreenElementRenderer;
|
||||
import com.simibubi.create.foundation.utility.Lang;
|
||||
import com.simibubi.create.modules.contraptions.base.StochasticOutput;
|
||||
import com.simibubi.create.modules.contraptions.receivers.SplashingRecipe;
|
||||
|
||||
import mezz.jei.api.constants.VanillaTypes;
|
||||
import mezz.jei.api.gui.IRecipeLayout;
|
||||
import mezz.jei.api.gui.drawable.IDrawable;
|
||||
import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.FlowingFluidBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
|
||||
public class SplashingCategory extends ProcessingViaFanCategory<SplashingRecipe> {
|
||||
|
||||
|
@ -46,9 +55,37 @@ public class SplashingCategory extends ProcessingViaFanCategory<SplashingRecipe>
|
|||
return Lang.translate("recipe.splashing");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setIngredients(SplashingRecipe recipe, IIngredients ingredients) {
|
||||
ingredients.setInputIngredients(recipe.getIngredients());
|
||||
ingredients.setOutputs(VanillaTypes.ITEM, recipe.getPossibleOutputs());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setRecipe(IRecipeLayout recipeLayout, SplashingRecipe recipe, IIngredients ingredients) {
|
||||
IGuiItemStackGroup itemStacks = recipeLayout.getItemStacks();
|
||||
itemStacks.init(0, true, 20, 67);
|
||||
itemStacks.set(0, Arrays.asList(recipe.getIngredients().get(0).getMatchingStacks()));
|
||||
|
||||
List<StochasticOutput> results = recipe.getRollableResults();
|
||||
for (int outputIndex = 0; outputIndex < results.size(); outputIndex++) {
|
||||
itemStacks.init(outputIndex + 1, false, 139, 58 + 19 * outputIndex);
|
||||
itemStacks.set(outputIndex + 1, results.get(outputIndex).getStack());
|
||||
}
|
||||
|
||||
itemStacks.addTooltipCallback((slotIndex, input, ingredient, tooltip) -> {
|
||||
if (input)
|
||||
return;
|
||||
StochasticOutput output = results.get(slotIndex - 1);
|
||||
if (output.getChance() != 1)
|
||||
tooltip.add(1, TextFormatting.GOLD
|
||||
+ Lang.translate("recipe.processing.chance", (int) (output.getChance() * 100)));
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public IDrawable getBackground() {
|
||||
return new ScreenResourceWrapper(ScreenResources.FAN_RECIPE);
|
||||
return new ScreenResourceWrapper(ScreenResources.WASHING_RECIPE);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -100,12 +100,12 @@ public interface IBlockWithScrollableValue {
|
|||
|
||||
if (contains) {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .5f, 1,
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, 1, .5f,
|
||||
.75f, 1f);
|
||||
} else {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .25f,
|
||||
.5f, .35f, 1f);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .5f,
|
||||
.25f, .35f, 1f);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
|
@ -127,13 +127,13 @@ public interface IBlockWithScrollableValue {
|
|||
GlStateManager.scaled(textScale, -textScale, textScale);
|
||||
|
||||
String text = block.getValueName(state, world, blockPos);
|
||||
mc.fontRenderer.drawString(text, 0, 0, 0x88FFBB);
|
||||
mc.fontRenderer.drawString(text, 0, 0, 0xFF88BB);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
mc.fontRenderer.drawString(text, 1, 1, 0x224433);
|
||||
GlStateManager.translated(0, 0, 1 / 4f);
|
||||
|
||||
text = TextFormatting.ITALIC + "<" + Lang.translate("action.scroll") + ">";
|
||||
mc.fontRenderer.drawString(text, 0, 10, 0xBBBBCC);
|
||||
mc.fontRenderer.drawString(text, 0, 10, 0xCCBBCC);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
mc.fontRenderer.drawString(text, 1, 11, 0x111111);
|
||||
GlStateManager.translated(0, 0, 1 / 4f);
|
||||
|
|
|
@ -243,9 +243,12 @@ public class EncasedFanTileEntity extends KineticTileEntity implements ITickable
|
|||
entity.attackEntityFrom(damageSourceLava, 8);
|
||||
}
|
||||
if (getProcessingType() == Type.SPLASHING) {
|
||||
entity.extinguish();
|
||||
world.playSound(null, entity.getPosition(), SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE,
|
||||
SoundCategory.NEUTRAL, 0.7F, 1.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F);
|
||||
if (entity.isBurning()) {
|
||||
entity.extinguish();
|
||||
world.playSound(null, entity.getPosition(), SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE,
|
||||
SoundCategory.NEUTRAL, 0.7F,
|
||||
1.6F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.4F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.block.BlockState;
|
|||
import net.minecraft.block.Blocks;
|
||||
import net.minecraft.block.HorizontalBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.BlockItemUseContext;
|
||||
import net.minecraft.state.StateContainer.Builder;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
@ -56,7 +57,7 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
return;
|
||||
|
||||
if (worldIn.isBlockPowered(pos)) {
|
||||
if (!te.finished && !te.running)
|
||||
if (!te.finished && !te.running && te.getSpeed() != 0)
|
||||
te.start(false);
|
||||
} else {
|
||||
te.finished = false;
|
||||
|
@ -92,17 +93,9 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
return true;
|
||||
}
|
||||
|
||||
public static class Head extends HorizontalBlock implements IRenderUtilityBlock {
|
||||
|
||||
public Head() {
|
||||
super(Properties.from(Blocks.AIR));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(HORIZONTAL_FACING);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
@Override
|
||||
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
onAttachmentPlaced(worldIn, pos, state);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -110,6 +103,14 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
return Arrays.asList(te.getPos().up(2));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onReplaced(BlockState state, World worldIn, BlockPos pos, BlockState newState, boolean isMoving) {
|
||||
onAttachmentRemoved(worldIn, pos, state);
|
||||
if (state.hasTileEntity() && state.getBlock() != newState.getBlock()) {
|
||||
worldIn.removeTileEntity(pos);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<BlockPos> getValidBeltPositionFor(IWorld world, BlockPos pos, BlockState state) {
|
||||
BlockState blockState = world.getBlockState(pos.down(2));
|
||||
|
@ -127,6 +128,10 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
if (pressTe == null || pressTe.getSpeed() == 0)
|
||||
return false;
|
||||
|
||||
// Not an Item
|
||||
if (!(entity instanceof ItemEntity))
|
||||
return false;
|
||||
|
||||
// Running
|
||||
if (pressTe.running) {
|
||||
double distanceTo = entity.getPositionVec().distanceTo(VecHelper.getCenterOf(te.getPos()));
|
||||
|
@ -142,8 +147,12 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
// Start process
|
||||
if (state.processingEntity != entity) {
|
||||
state.processingEntity = entity;
|
||||
state.processingDuration = 1;
|
||||
pressTe.start(true);
|
||||
if (!pressTe.getRecipe((ItemEntity) entity).isPresent()) {
|
||||
state.processingDuration = -1;
|
||||
} else {
|
||||
state.processingDuration = 1;
|
||||
pressTe.start(true);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -160,4 +169,17 @@ public class MechanicalPressBlock extends HorizontalKineticBlock
|
|||
return false;
|
||||
}
|
||||
|
||||
public static class Head extends HorizontalBlock implements IRenderUtilityBlock {
|
||||
|
||||
public Head() {
|
||||
super(Properties.from(Blocks.AIR));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void fillStateContainer(Builder<Block, BlockState> builder) {
|
||||
builder.add(HORIZONTAL_FACING);
|
||||
super.fillStateContainer(builder);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -4,15 +4,21 @@ import java.util.Optional;
|
|||
|
||||
import com.simibubi.create.AllRecipes;
|
||||
import com.simibubi.create.AllTileEntities;
|
||||
import com.simibubi.create.foundation.utility.VecHelper;
|
||||
import com.simibubi.create.modules.contraptions.base.KineticTileEntity;
|
||||
import com.simibubi.create.modules.logistics.InWorldProcessing;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.particles.ItemParticleData;
|
||||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
|
||||
|
@ -59,11 +65,12 @@ public class MechanicalPressTileEntity extends KineticTileEntity implements ITic
|
|||
|
||||
public float getRenderedHeadOffset(float partialTicks) {
|
||||
if (running) {
|
||||
if (runningTicks < 50) {
|
||||
return MathHelper.clamp((runningTicks - 1 + partialTicks) / 20f, 0, beltMode ? 1 + 3 / 16f : 1);
|
||||
if (runningTicks < 40) {
|
||||
float num = (runningTicks - 1 + partialTicks) / 30f;
|
||||
return MathHelper.clamp(num * num * num, 0, beltMode ? 1 + 3 / 16f : 1);
|
||||
}
|
||||
if (runningTicks >= 50) {
|
||||
return MathHelper.clamp(((100 - runningTicks) + 1 - partialTicks) / 20f, 0, beltMode ? 1 + 3 / 16f : 1);
|
||||
if (runningTicks >= 40) {
|
||||
return MathHelper.clamp(((60 - runningTicks) + 1 - partialTicks) / 20f, 0, beltMode ? 1 + 3 / 16f : 1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -81,21 +88,34 @@ public class MechanicalPressTileEntity extends KineticTileEntity implements ITic
|
|||
if (!running)
|
||||
return;
|
||||
|
||||
if (!world.isRemote && runningTicks > 100) {
|
||||
|
||||
if (runningTicks == 30) {
|
||||
AxisAlignedBB bb = new AxisAlignedBB(pos.down(beltMode ? 2 : 1));
|
||||
for (Entity entity : world.getEntitiesWithinAABBExcludingEntity(null, bb)) {
|
||||
if (!(entity instanceof ItemEntity))
|
||||
continue;
|
||||
|
||||
ItemEntity itemEntity = (ItemEntity) entity;
|
||||
pressingInv.setInventorySlotContents(0, itemEntity.getItem());
|
||||
Optional<PressingRecipe> recipe = world.getRecipeManager().getRecipe(AllRecipes.Types.PRESSING,
|
||||
pressingInv, world);
|
||||
if (recipe.isPresent())
|
||||
InWorldProcessing.applyRecipeOn(itemEntity, recipe.get());
|
||||
}
|
||||
|
||||
if (world.isRemote) {
|
||||
for (int i = 0; i < 20; i++) {
|
||||
Vec3d motion = VecHelper.offsetRandomly(Vec3d.ZERO, world.rand, .25f).mul(1, 0, 1);
|
||||
world.addParticle(new ItemParticleData(ParticleTypes.ITEM, itemEntity.getItem()), entity.posX,
|
||||
entity.posY, entity.posZ, motion.x, motion.y, motion.z);
|
||||
}
|
||||
}
|
||||
|
||||
if (!world.isRemote) {
|
||||
Optional<PressingRecipe> recipe = getRecipe(itemEntity);
|
||||
if (recipe.isPresent())
|
||||
InWorldProcessing.applyRecipeOn(itemEntity, recipe.get());
|
||||
}
|
||||
}
|
||||
if (!world.isRemote) {
|
||||
world.playSound(null, getPos(), SoundEvents.ENTITY_ITEM_BREAK, SoundCategory.BLOCKS, .5f, 1f);
|
||||
world.playSound(null, getPos(), SoundEvents.BLOCK_ANVIL_LAND, SoundCategory.BLOCKS, .125f, 1f);
|
||||
}
|
||||
}
|
||||
|
||||
if (!world.isRemote && runningTicks > 60) {
|
||||
finished = true;
|
||||
if (!beltMode)
|
||||
finished = world.isBlockPowered(pos);
|
||||
|
@ -107,4 +127,11 @@ public class MechanicalPressTileEntity extends KineticTileEntity implements ITic
|
|||
runningTicks++;
|
||||
}
|
||||
|
||||
public Optional<PressingRecipe> getRecipe(ItemEntity itemEntity) {
|
||||
pressingInv.setInventorySlotContents(0, itemEntity.getItem());
|
||||
Optional<PressingRecipe> recipe = world.getRecipeManager().getRecipe(AllRecipes.Types.PRESSING, pressingInv,
|
||||
world);
|
||||
return recipe;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Optional;
|
|||
import java.util.function.Consumer;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
import com.simibubi.create.Create;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -76,9 +77,11 @@ public enum AllBeltAttachments {
|
|||
|
||||
public static class Tracker {
|
||||
public List<BeltAttachmentState> attachments;
|
||||
private BeltTileEntity te;
|
||||
|
||||
public Tracker() {
|
||||
public Tracker(BeltTileEntity te) {
|
||||
attachments = new ArrayList<>(0);
|
||||
this.te = te;
|
||||
}
|
||||
|
||||
public void findAttachments(BeltTileEntity belt) {
|
||||
|
@ -103,8 +106,13 @@ public enum AllBeltAttachments {
|
|||
public BeltAttachmentState addAttachment(IWorld world, BlockPos pos) {
|
||||
BlockState state = world.getBlockState(pos);
|
||||
removeAttachment(pos);
|
||||
if (!(state.getBlock() instanceof IBeltAttachment)) {
|
||||
Create.logger.warn("Missing belt attachment for Belt at " + pos.toString());
|
||||
return null;
|
||||
}
|
||||
BeltAttachmentState newAttachmentState = new BeltAttachmentState((IBeltAttachment) state.getBlock(), pos);
|
||||
attachments.add(newAttachmentState);
|
||||
te.markDirty();
|
||||
return newAttachmentState;
|
||||
}
|
||||
|
||||
|
@ -115,6 +123,7 @@ public enum AllBeltAttachments {
|
|||
toRemove = atState;
|
||||
if (toRemove != null)
|
||||
attachments.remove(toRemove);
|
||||
te.markDirty();
|
||||
}
|
||||
|
||||
public void forEachAttachment(Consumer<BeltAttachmentState> consumer) {
|
||||
|
@ -131,6 +140,8 @@ public enum AllBeltAttachments {
|
|||
CompoundNBT stateNBT = (CompoundNBT) data;
|
||||
BlockPos attachmentPos = NBTUtil.readBlockPos(stateNBT.getCompound("Position"));
|
||||
BeltAttachmentState atState = addAttachment(belt.getWorld(), attachmentPos);
|
||||
if (atState == null)
|
||||
continue;
|
||||
atState.processingDuration = stateNBT.getInt("Duration");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -66,7 +66,7 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn
|
|||
public BeltTileEntity() {
|
||||
super(AllTileEntities.BELT.type);
|
||||
controller = BlockPos.ZERO;
|
||||
attachmentTracker = new Tracker();
|
||||
attachmentTracker = new Tracker(this);
|
||||
color = -1;
|
||||
}
|
||||
|
||||
|
@ -187,15 +187,6 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn
|
|||
return;
|
||||
}
|
||||
|
||||
if (entityIn instanceof ItemEntity) {
|
||||
if (speed == 0) {
|
||||
((ItemEntity) entityIn).setAgeToCreativeDespawnTime();
|
||||
} else {
|
||||
if (((ItemEntity) entityIn).getAge() > 0)
|
||||
((ItemEntity) entityIn).setNoDespawn();
|
||||
}
|
||||
}
|
||||
|
||||
if (speed == 0)
|
||||
return;
|
||||
|
||||
|
@ -227,7 +218,8 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn
|
|||
Vec3d movement = new Vec3d(movementDirection.getDirectionVec()).scale(movementSpeed);
|
||||
|
||||
double diffCenter = axis == Axis.Z ? (pos.getX() + .5f - entityIn.posX) : (pos.getZ() + .5f - entityIn.posZ);
|
||||
if (Math.abs(diffCenter) > 48 / 64f)
|
||||
float maxDiffCenter = (entityIn instanceof ItemEntity)? 32 / 64f : 48 / 64f;
|
||||
if (Math.abs(diffCenter) > maxDiffCenter)
|
||||
return;
|
||||
|
||||
Part part = blockState.get(BeltBlock.PART);
|
||||
|
@ -257,7 +249,7 @@ public class BeltTileEntity extends KineticTileEntity implements ITickableTileEn
|
|||
entityIn.stepHeight = 1;
|
||||
|
||||
if (Math.abs(movementSpeed) < .5f) {
|
||||
Vec3d checkDistance = movement.scale(2f).add(movement.normalize().scale(.5));
|
||||
Vec3d checkDistance = movement.scale(2f).add(movement.normalize());
|
||||
AxisAlignedBB bb = entityIn.getBoundingBox();
|
||||
AxisAlignedBB checkBB = new AxisAlignedBB(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
|
||||
if (!world
|
||||
|
|
|
@ -32,7 +32,7 @@ public class FrequencyHandler {
|
|||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return stack;
|
||||
return stack.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.simibubi.create.modules.logistics;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
|
@ -10,7 +11,6 @@ import com.simibubi.create.modules.contraptions.receivers.SplashingRecipe;
|
|||
|
||||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.Items;
|
||||
import net.minecraft.item.crafting.BlastingRecipe;
|
||||
import net.minecraft.item.crafting.FurnaceRecipe;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
|
@ -21,6 +21,7 @@ import net.minecraft.tileentity.BlastFurnaceTileEntity;
|
|||
import net.minecraft.tileentity.FurnaceTileEntity;
|
||||
import net.minecraft.tileentity.SmokerTileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.items.ItemHandlerHelper;
|
||||
import net.minecraftforge.items.ItemStackHandler;
|
||||
import net.minecraftforge.items.wrapper.RecipeWrapper;
|
||||
|
||||
|
@ -111,7 +112,7 @@ public class InWorldProcessing {
|
|||
}
|
||||
}
|
||||
|
||||
entity.setItem(new ItemStack(Items.GUNPOWDER, entity.getItem().getCount()));
|
||||
entity.remove();
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -144,10 +145,38 @@ public class InWorldProcessing {
|
|||
}
|
||||
|
||||
public static void applyRecipeOn(ItemEntity entity, IRecipe<?> recipe) {
|
||||
ItemStack out = recipe.getRecipeOutput().copy();
|
||||
List<ItemStack> stacks = ItemHelper.multipliedOutput(entity.getItem(), out);
|
||||
if (stacks.isEmpty())
|
||||
List<ItemStack> stacks;
|
||||
|
||||
if (recipe instanceof SplashingRecipe) {
|
||||
stacks = new ArrayList<>();
|
||||
for (int i = 0; i < entity.getItem().getCount(); i++) {
|
||||
for (ItemStack stack : ((SplashingRecipe) recipe).rollResults()) {
|
||||
for (ItemStack previouslyRolled : stacks) {
|
||||
if (stack.isEmpty())
|
||||
continue;
|
||||
if (!ItemHandlerHelper.canItemStacksStack(stack, previouslyRolled))
|
||||
continue;
|
||||
int amount = Math.min(previouslyRolled.getMaxStackSize() - previouslyRolled.getCount(),
|
||||
stack.getCount());
|
||||
previouslyRolled.grow(amount);
|
||||
stack.shrink(amount);
|
||||
}
|
||||
|
||||
if (stack.isEmpty())
|
||||
continue;
|
||||
|
||||
stacks.add(stack);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
ItemStack out = recipe.getRecipeOutput().copy();
|
||||
stacks = ItemHelper.multipliedOutput(entity.getItem(), out);
|
||||
}
|
||||
|
||||
if (stacks.isEmpty()) {
|
||||
entity.remove();
|
||||
return;
|
||||
}
|
||||
entity.setItem(stacks.remove(0));
|
||||
for (ItemStack additional : stacks)
|
||||
entity.world.addEntity(new ItemEntity(entity.world, entity.posX, entity.posY, entity.posZ, additional));
|
||||
|
|
|
@ -10,6 +10,8 @@ import net.minecraft.particles.ItemParticleData;
|
|||
import net.minecraft.particles.ParticleTypes;
|
||||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
import net.minecraftforge.common.util.LazyOptional;
|
||||
|
@ -92,8 +94,10 @@ public class BeltFunnelTileEntity extends SyncedTileEntity implements ITickableT
|
|||
for (int slot = 0; slot < inv.getSlots(); slot++) {
|
||||
stack = inv.insertItem(slot, stack, world.isRemote);
|
||||
if (stack.isEmpty()) {
|
||||
if (!world.isRemote)
|
||||
if (!world.isRemote) {
|
||||
entity.remove();
|
||||
world.playSound(null, pos, SoundEvents.ENTITY_GENERIC_EAT, SoundCategory.BLOCKS, .125f, 1f);
|
||||
}
|
||||
else {
|
||||
Vec3i directionVec = getBlockState().get(BlockStateProperties.HORIZONTAL_FACING).getDirectionVec();
|
||||
float xSpeed = directionVec.getX() * 1/8f;
|
||||
|
|
|
@ -179,6 +179,9 @@ public class EntityDetectorBlock extends HorizontalBlock
|
|||
@Override
|
||||
public boolean handleEntity(BeltTileEntity te, Entity entity, BeltAttachmentState state) {
|
||||
|
||||
if (te.getWorld().isRemote)
|
||||
return false;
|
||||
|
||||
if (state.processingEntity != entity) {
|
||||
state.processingEntity = entity;
|
||||
state.processingDuration = 0;
|
||||
|
@ -207,7 +210,7 @@ public class EntityDetectorBlock extends HorizontalBlock
|
|||
|
||||
state.processingDuration = -1;
|
||||
world.setBlockState(state.attachmentPos, blockState.with(POWERED, true));
|
||||
world.getPendingBlockTicks().scheduleTick(state.attachmentPos, this, 4);
|
||||
world.getPendingBlockTicks().scheduleTick(state.attachmentPos, this, 6);
|
||||
world.notifyNeighborsOfStateChange(state.attachmentPos, this);
|
||||
|
||||
return false;
|
||||
|
@ -215,7 +218,7 @@ public class EntityDetectorBlock extends HorizontalBlock
|
|||
|
||||
@Override
|
||||
public void tick(BlockState state, World worldIn, BlockPos pos, Random random) {
|
||||
worldIn.setBlockState(pos, state.with(POWERED, false));
|
||||
worldIn.setBlockState(pos, state.with(POWERED, false), 2);
|
||||
worldIn.notifyNeighborsOfStateChange(pos, this);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,13 +29,14 @@ public class EntityDetectorTileEntity extends SyncedTileEntity implements IHaveF
|
|||
|
||||
@Override
|
||||
public void setFilter(ItemStack stack) {
|
||||
filter = stack;
|
||||
filter = stack.copy();
|
||||
markDirty();
|
||||
sendData();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFilter() {
|
||||
return filter;
|
||||
return filter.copy();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -16,8 +16,8 @@ import net.minecraft.state.StateContainer.Builder;
|
|||
import net.minecraft.state.properties.BlockStateProperties;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Direction.Axis;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
|
@ -48,6 +48,11 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
|
|||
super.fillStateContainer(builder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean showsCount() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(BlockState state) {
|
||||
return true;
|
||||
|
@ -80,8 +85,6 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
|
|||
@Override
|
||||
public void onBlockAdded(BlockState state, World worldIn, BlockPos pos, BlockState oldState, boolean isMoving) {
|
||||
updateObservedInventory(state, worldIn, pos);
|
||||
|
||||
cacheItemPositions();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -137,8 +140,6 @@ public class ExtractorBlock extends HorizontalBlock implements IBlockWithFilter
|
|||
}
|
||||
|
||||
private void cacheItemPositions() {
|
||||
// if (!itemPositions.isEmpty())
|
||||
// return;
|
||||
itemPositions.clear();
|
||||
|
||||
Vec3d position = Vec3d.ZERO;
|
||||
|
|
|
@ -22,7 +22,8 @@ public class ExtractorTileEntity extends SyncedTileEntity implements IExtractor,
|
|||
|
||||
public ExtractorTileEntity() {
|
||||
super(AllTileEntities.EXTRACTOR.type);
|
||||
state = State.WAITING_FOR_INVENTORY;
|
||||
state = State.ON_COOLDOWN;
|
||||
cooldown = CreateConfig.parameters.extractorDelay.get();
|
||||
inventory = LazyOptional.empty();
|
||||
filter = ItemStack.EMPTY;
|
||||
}
|
||||
|
@ -35,12 +36,15 @@ public class ExtractorTileEntity extends SyncedTileEntity implements IExtractor,
|
|||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
filter = ItemStack.read(compound.getCompound("Filter"));
|
||||
if (compound.getBoolean("Locked"))
|
||||
setState(State.LOCKED);
|
||||
super.read(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
compound.put("Filter", filter.serializeNBT());
|
||||
compound.putBoolean("Locked", getState() == State.LOCKED);
|
||||
return super.write(compound);
|
||||
}
|
||||
|
||||
|
@ -52,6 +56,8 @@ public class ExtractorTileEntity extends SyncedTileEntity implements IExtractor,
|
|||
@Override
|
||||
public void tick() {
|
||||
if (initialize && hasWorld()) {
|
||||
if (world.isBlockPowered(pos))
|
||||
state = State.LOCKED;
|
||||
neighborChanged();
|
||||
initialize = false;
|
||||
}
|
||||
|
@ -87,13 +93,15 @@ public class ExtractorTileEntity extends SyncedTileEntity implements IExtractor,
|
|||
|
||||
@Override
|
||||
public void setFilter(ItemStack stack) {
|
||||
filter = stack;
|
||||
filter = stack.copy();
|
||||
markDirty();
|
||||
sendData();
|
||||
neighborChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFilter() {
|
||||
return filter;
|
||||
return filter.copy();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@ import com.simibubi.create.foundation.utility.TessellatorHelper;
|
|||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.WorldRenderer;
|
||||
|
@ -40,13 +41,17 @@ public interface IBlockWithFilter {
|
|||
return 2 / 16f;
|
||||
}
|
||||
|
||||
public default boolean handleActivatedFilterSlots(BlockState state, World worldIn, BlockPos pos, PlayerEntity player,
|
||||
Hand handIn, BlockRayTraceResult hit) {
|
||||
public default boolean showsCount() {
|
||||
return false;
|
||||
}
|
||||
|
||||
public default boolean handleActivatedFilterSlots(BlockState state, World worldIn, BlockPos pos,
|
||||
PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
TileEntity te = worldIn.getTileEntity(pos);
|
||||
if (te == null || !(te instanceof IHaveFilter))
|
||||
return false;
|
||||
|
||||
IHaveFilter actor = (IHaveFilter) te;
|
||||
|
||||
Vec3d vec = new Vec3d(pos);
|
||||
Vec3d position = vec.add(getFilterPosition(state));
|
||||
ItemStack stack = player.getHeldItem(handIn);
|
||||
|
@ -75,13 +80,18 @@ public interface IBlockWithFilter {
|
|||
|
||||
if (!(state.getBlock() instanceof IBlockWithFilter))
|
||||
return;
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if (te == null || !(te instanceof IHaveFilter))
|
||||
return;
|
||||
IHaveFilter actor = (IHaveFilter) te;
|
||||
|
||||
IBlockWithFilter filterBlock = (IBlockWithFilter) state.getBlock();
|
||||
Vec3d vec = new Vec3d(pos);
|
||||
Vec3d position = filterBlock.getFilterPosition(state).add(vec);
|
||||
float scale = filterBlock.getItemHitboxScale();
|
||||
|
||||
AxisAlignedBB bb = new AxisAlignedBB(position, position).grow(scale, scale / 1.25f, scale).offset(0, -scale / 16f, 0);
|
||||
AxisAlignedBB bb = new AxisAlignedBB(position, position).grow(scale, scale / 1.25f, scale).offset(0,
|
||||
-scale / 16f, 0);
|
||||
boolean contains = bb.grow(scale).contains(result.getHitVec());
|
||||
|
||||
TessellatorHelper.prepareForDrawing();
|
||||
|
@ -108,10 +118,12 @@ public interface IBlockWithFilter {
|
|||
|
||||
if (contains) {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .5f, 1, .75f, 1f);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .5f, 1,
|
||||
.75f, 1f);
|
||||
} else {
|
||||
GlStateManager.lineWidth(2);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .25f, .5f, .35f, 1f);
|
||||
WorldRenderer.drawBoundingBox(bufferbuilder, bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ, .25f,
|
||||
.5f, .35f, 1f);
|
||||
}
|
||||
|
||||
tessellator.draw();
|
||||
|
@ -121,7 +133,7 @@ public interface IBlockWithFilter {
|
|||
GlStateManager.depthMask(true);
|
||||
|
||||
if (contains) {
|
||||
float textScale = 1/128f;
|
||||
float textScale = 1 / 128f;
|
||||
GlStateManager.translated(position.x, position.y, position.z);
|
||||
GlStateManager.rotated(facing.getHorizontalAngle() * (facing.getAxis() == Axis.X ? -1 : 1), 0, 1, 0);
|
||||
GlStateManager.scaled(textScale, -textScale, textScale);
|
||||
|
@ -129,9 +141,19 @@ public interface IBlockWithFilter {
|
|||
GlStateManager.rotated(67.5f, 1, 0, 0);
|
||||
|
||||
String text = Lang.translate("logistics.filter");
|
||||
Minecraft.getInstance().fontRenderer.drawString(text, 0, 0, 0x88FFBB);
|
||||
GlStateManager.translated(0, 0, -1/4f);
|
||||
Minecraft.getInstance().fontRenderer.drawString(text, 1, 1, 0x224433);
|
||||
FontRenderer font = Minecraft.getInstance().fontRenderer;
|
||||
font.drawString(text, 0, 0, 0x88FFBB);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
font.drawString(text, 1, 1, 0x224433);
|
||||
|
||||
if (filterBlock.showsCount() && !actor.getFilter().isEmpty()) {
|
||||
String count = actor.getFilter().getCount() + "";
|
||||
GlStateManager.translated(-7 - font.getStringWidth(count), 10, 10 + 1 / 4f);
|
||||
GlStateManager.scaled(1.5,1.5, 1.5);
|
||||
font.drawString(count, 0, 0, 0xEDEDED);
|
||||
GlStateManager.translated(0, 0, -1 / 4f);
|
||||
font.drawString(count, 1, 1, 0x4F4F4F);
|
||||
}
|
||||
}
|
||||
GlStateManager.disableBlend();
|
||||
|
||||
|
|
|
@ -6,6 +6,8 @@ import com.simibubi.create.foundation.utility.VecHelper;
|
|||
import net.minecraft.entity.item.ItemEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.util.SoundCategory;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraft.world.World;
|
||||
|
@ -36,8 +38,11 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
|
||||
if (state == State.ON_COOLDOWN) {
|
||||
int cooldown = tickCooldown();
|
||||
if (cooldown <= 0)
|
||||
if (cooldown <= 0) {
|
||||
setState(State.RUNNING);
|
||||
if (!getInventory().isPresent())
|
||||
findNewInventory();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -48,9 +53,8 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
if (hasSpace && hasInventory) {
|
||||
toExtract = extract(true);
|
||||
|
||||
ItemStack filter = (this instanceof IHaveFilter) ? filter = ((IHaveFilter) this).getFilter()
|
||||
: ItemStack.EMPTY;
|
||||
if (!filter.isEmpty() && !ItemStack.areItemsEqual(toExtract, filter))
|
||||
ItemStack filterItem = (this instanceof IHaveFilter) ? ((IHaveFilter) this).getFilter() : ItemStack.EMPTY;
|
||||
if (!filterItem.isEmpty() && !ItemStack.areItemsEqual(toExtract, filterItem))
|
||||
toExtract = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
|
@ -91,9 +95,8 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
|
||||
if (hasSpace && hasInventory) {
|
||||
toExtract = extract(true);
|
||||
ItemStack filter = (this instanceof IHaveFilter) ? filter = ((IHaveFilter) this).getFilter()
|
||||
: ItemStack.EMPTY;
|
||||
if (!filter.isEmpty() && !ItemStack.areItemsEqual(toExtract, filter))
|
||||
ItemStack filterItem = (this instanceof IHaveFilter) ? ((IHaveFilter) this).getFilter() : ItemStack.EMPTY;
|
||||
if (!filterItem.isEmpty() && !ItemStack.areItemsEqual(toExtract, filterItem))
|
||||
toExtract = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
|
@ -116,33 +119,59 @@ public interface IExtractor extends ITickableTileEntity, IInventoryManipulator {
|
|||
default ItemStack extract(boolean simulate) {
|
||||
IItemHandler inv = getInventory().orElse(null);
|
||||
ItemStack extracting = ItemStack.EMPTY;
|
||||
ItemStack filter = (this instanceof IHaveFilter) ? filter = ((IHaveFilter) this).getFilter() : ItemStack.EMPTY;
|
||||
int extractionCount = filter.isEmpty() ? CreateConfig.parameters.extractorAmount.get() : filter.getCount();
|
||||
ItemStack filterItem = (this instanceof IHaveFilter) ? ((IHaveFilter) this).getFilter() : ItemStack.EMPTY;
|
||||
int extractionCount = filterItem.isEmpty() ? CreateConfig.parameters.extractorAmount.get()
|
||||
: filterItem.getCount();
|
||||
boolean checkHasEnoughItems = !filterItem.isEmpty();
|
||||
boolean hasEnoughItems = !checkHasEnoughItems;
|
||||
|
||||
for (int slot = 0; slot < inv.getSlots(); slot++) {
|
||||
ItemStack stack = inv.extractItem(slot, extractionCount - extracting.getCount(), true);
|
||||
ItemStack compare = stack.copy();
|
||||
compare.setCount(extracting.getCount());
|
||||
if (!extracting.isEmpty() && !extracting.equals(compare, false))
|
||||
continue;
|
||||
Extraction: do {
|
||||
extracting = ItemStack.EMPTY;
|
||||
|
||||
if (extracting.isEmpty())
|
||||
extracting = stack.copy();
|
||||
for (int slot = 0; slot < inv.getSlots(); slot++) {
|
||||
ItemStack stack = inv.extractItem(slot, extractionCount - extracting.getCount(), true);
|
||||
ItemStack compare = stack.copy();
|
||||
|
||||
compare.setCount(filterItem.getCount());
|
||||
if (!filterItem.isEmpty() && !filterItem.equals(compare, false))
|
||||
continue;
|
||||
|
||||
compare.setCount(extracting.getCount());
|
||||
if (!extracting.isEmpty() && !extracting.equals(compare, false))
|
||||
continue;
|
||||
|
||||
if (extracting.isEmpty())
|
||||
extracting = stack.copy();
|
||||
else
|
||||
extracting.grow(stack.getCount());
|
||||
|
||||
if (!simulate && hasEnoughItems)
|
||||
inv.extractItem(slot, stack.getCount(), false);
|
||||
|
||||
if (extracting.getCount() >= extractionCount) {
|
||||
if (checkHasEnoughItems) {
|
||||
hasEnoughItems = true;
|
||||
checkHasEnoughItems = false;
|
||||
continue Extraction;
|
||||
} else {
|
||||
break Extraction;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (checkHasEnoughItems)
|
||||
checkHasEnoughItems = false;
|
||||
else
|
||||
extracting.grow(stack.getCount());
|
||||
break Extraction;
|
||||
} while (true);
|
||||
|
||||
if (!simulate)
|
||||
inv.extractItem(slot, stack.getCount(), false);
|
||||
if (extracting.getCount() >= extractionCount)
|
||||
break;
|
||||
}
|
||||
|
||||
if (!simulate) {
|
||||
if (!simulate && hasEnoughItems) {
|
||||
World world = getWorld();
|
||||
Vec3d pos = VecHelper.getCenterOf(getPos()).add(0, -0.5f, 0);
|
||||
ItemEntity entityIn = new ItemEntity(world, pos.x, pos.y, pos.z, extracting);
|
||||
entityIn.setMotion(Vec3d.ZERO);
|
||||
world.addEntity(entityIn);
|
||||
world.playSound(null, getPos(), SoundEvents.ENTITY_ITEM_PICKUP, SoundCategory.BLOCKS, .125f, .1f);
|
||||
}
|
||||
|
||||
return extracting;
|
||||
|
|
|
@ -23,14 +23,21 @@ public class LinkedExtractorTileEntity extends LinkedTileEntity
|
|||
private ItemStack filter;
|
||||
private int cooldown;
|
||||
private LazyOptional<IItemHandler> inventory;
|
||||
private boolean initialize;
|
||||
|
||||
public LinkedExtractorTileEntity() {
|
||||
super(AllTileEntities.LINKED_EXTRACTOR.type);
|
||||
state = State.WAITING_FOR_INVENTORY;
|
||||
setState(State.ON_COOLDOWN);
|
||||
inventory = LazyOptional.empty();
|
||||
filter = ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLoad() {
|
||||
super.onLoad();
|
||||
initialize = true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSignal(boolean powered) {
|
||||
receivedSignal = powered;
|
||||
|
@ -39,18 +46,29 @@ public class LinkedExtractorTileEntity extends LinkedTileEntity
|
|||
@Override
|
||||
public void read(CompoundNBT compound) {
|
||||
filter = ItemStack.read(compound.getCompound("Filter"));
|
||||
if (compound.getBoolean("Locked"))
|
||||
setState(State.LOCKED);
|
||||
super.read(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CompoundNBT write(CompoundNBT compound) {
|
||||
compound.put("Filter", filter.serializeNBT());
|
||||
compound.putBoolean("Locked", getState() == State.LOCKED);
|
||||
return super.write(compound);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (initialize && hasWorld()) {
|
||||
if (world.isBlockPowered(pos))
|
||||
state = State.LOCKED;
|
||||
neighborChanged();
|
||||
initialize = false;
|
||||
}
|
||||
|
||||
IExtractor.super.tick();
|
||||
|
||||
if (world.isRemote)
|
||||
return;
|
||||
if (receivedSignal != getBlockState().get(POWERED)) {
|
||||
|
@ -94,13 +112,15 @@ public class LinkedExtractorTileEntity extends LinkedTileEntity
|
|||
|
||||
@Override
|
||||
public void setFilter(ItemStack stack) {
|
||||
filter = stack;
|
||||
filter = stack.copy();
|
||||
markDirty();
|
||||
sendData();
|
||||
neighborChanged();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getFilter() {
|
||||
return filter;
|
||||
return filter.copy();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -76,8 +76,7 @@ public class RedstoneBridgeBlock extends ProperDirectionalBlock implements IBloc
|
|||
if (state.get(RECEIVER))
|
||||
return;
|
||||
|
||||
boolean shouldPower = worldIn.getWorld().isBlockPowered(pos.offset(blockFacing.getOpposite()))
|
||||
|| worldIn.getWorld().isBlockPowered(pos);
|
||||
boolean shouldPower = worldIn.getWorld().isBlockPowered(pos);
|
||||
boolean previouslyPowered = state.get(POWERED);
|
||||
|
||||
if (previouslyPowered != shouldPower) {
|
||||
|
@ -151,7 +150,7 @@ public class RedstoneBridgeBlock extends ProperDirectionalBlock implements IBloc
|
|||
|
||||
@Override
|
||||
public boolean canConnectRedstone(BlockState state, IBlockReader world, BlockPos pos, Direction side) {
|
||||
return state.get(FACING) == Direction.UP;
|
||||
return state.get(FACING) == Direction.UP && side != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -42,7 +42,7 @@ public class PulseRepeaterBlock extends RedstoneDiodeBlock {
|
|||
boolean shouldPower = shouldBePowered(worldIn, pos, state);
|
||||
|
||||
if (pulsing) {
|
||||
worldIn.setBlockState(pos, state.with(POWERED, true).with(PULSING, false), 2);
|
||||
worldIn.setBlockState(pos, state.with(POWERED, shouldPower).with(PULSING, false), 2);
|
||||
} else if (powered && !shouldPower) {
|
||||
worldIn.setBlockState(pos, state.with(POWERED, false).with(PULSING, false), 2);
|
||||
} else if (!powered) {
|
||||
|
|
|
@ -546,7 +546,7 @@
|
|||
"block.create.stockswitch.tooltip.action1": "Opens the _Configuration_ _Interface_",
|
||||
|
||||
"block.create.redstone_bridge.tooltip": "REDSTONE LINK",
|
||||
"block.create.redstone_bridge.tooltip.summary": "Endpoints for _Wireless_ _Redstone_ connections. Can be assigned _Frequencies_ using any item. Signal can travel distances up to _128m_",
|
||||
"block.create.redstone_bridge.tooltip.summary": "Endpoints for _Wireless_ _Redstone_ connections. Can be assigned _Frequencies_ using any item. Signal range is limited, but reasonably far.",
|
||||
"block.create.redstone_bridge.tooltip.condition1": "When Powered",
|
||||
"block.create.redstone_bridge.tooltip.behaviour1": "Receiving Links of the same _Frequency_ will provide a Redstone signal.",
|
||||
"block.create.redstone_bridge.tooltip.control1": "When R-Clicked with an Item",
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
}
|
||||
},
|
||||
"textures": {
|
||||
"extractor": "create:block/extractor"
|
||||
"extractor": "create:block/extractor",
|
||||
"particle": "create:block/extractor"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
},
|
||||
"textures": {
|
||||
"redstone_antenna": "create:block/redstone_antenna",
|
||||
"extractor": "create:block/extractor"
|
||||
"extractor": "create:block/extractor",
|
||||
"particle": "create:block/extractor"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
|
@ -7,7 +7,8 @@
|
|||
"mechanical_press_pole": "create:block/mechanical_press_pole",
|
||||
"gearbox": "create:block/gearbox",
|
||||
"mechanical_press_top": "create:block/mechanical_press_top",
|
||||
"mechanical_press_bottom": "create:block/mechanical_press_bottom"
|
||||
"mechanical_press_bottom": "create:block/mechanical_press_bottom",
|
||||
"particle": "create:block/gearbox_top"
|
||||
},
|
||||
"display": {
|
||||
"gui": {
|
||||
|
|
BIN
src/main/resources/assets/create/textures/gui/recipes3.png
Normal file
BIN
src/main/resources/assets/create/textures/gui/recipes3.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:coal_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"count": 2
|
||||
},
|
||||
{
|
||||
"item": "minecraft:coal",
|
||||
"count": 2,
|
||||
"chance": 0.5
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 300
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:diamond_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:diamond",
|
||||
"count": 2
|
||||
},
|
||||
{
|
||||
"item": "minecraft:diamond",
|
||||
"count": 1,
|
||||
"chance": 0.25
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 500
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:emerald_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:emerald",
|
||||
"count": 2
|
||||
},
|
||||
{
|
||||
"item": "minecraft:emerald",
|
||||
"count": 1,
|
||||
"chance": 0.25
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 500
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:gold_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:gold_ingot",
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gold_nugget",
|
||||
"count": 9,
|
||||
"chance": 0.5
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 350
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:iron_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:iron_ingot",
|
||||
"count": 1
|
||||
},
|
||||
{
|
||||
"item": "minecraft:iron_nugget",
|
||||
"count": 9,
|
||||
"chance": 0.5
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 400
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:lapis_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:lapis_lazuli",
|
||||
"count": 12
|
||||
},
|
||||
{
|
||||
"item": "minecraft:lapis_lazuli",
|
||||
"count": 8,
|
||||
"chance": 0.25
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 300
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:nether_quartz_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:quartz",
|
||||
"count": 2
|
||||
},
|
||||
{
|
||||
"item": "minecraft:quartz",
|
||||
"count": 4,
|
||||
"chance": 0.5
|
||||
},
|
||||
{
|
||||
"item": "minecraft:netherrack",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 350
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:redstone_ore"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:redstone",
|
||||
"count": 8
|
||||
},
|
||||
{
|
||||
"item": "minecraft:redstone",
|
||||
"count": 6,
|
||||
"chance": 0.25
|
||||
},
|
||||
{
|
||||
"item": "minecraft:cobblestone",
|
||||
"count": 1,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 300
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:crushing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:terracotta"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:red_sand",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 200
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:black_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:black_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:blue_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:blue_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:brown_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:brown_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
16
src/main/resources/data/create/recipes/splashing/bucket.json
Normal file
16
src/main/resources/data/create/recipes/splashing/bucket.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:bucket"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:water_bucket",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:cyan_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:cyan_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
22
src/main/resources/data/create/recipes/splashing/gravel.json
Normal file
22
src/main/resources/data/create/recipes/splashing/gravel.json
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:gravel"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:flint",
|
||||
"count": 1,
|
||||
"chance": 0.5
|
||||
},
|
||||
{
|
||||
"item": "minecraft:iron_nugget",
|
||||
"count": 4,
|
||||
"chance": 0.125
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:gray_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:gray_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:green_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:green_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
16
src/main/resources/data/create/recipes/splashing/ice.json
Normal file
16
src/main/resources/data/create/recipes/splashing/ice.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:ice"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:packed_ice",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:light_blue_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:light_blue_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:light_gray_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:light_gray_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:lime_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:lime_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:magenta_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:magenta_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:magma_block"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:obsidian",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:orange_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:orange_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:pink_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:pink_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:purple_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:purple_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:red_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:red_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:red_sand"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:gold_nugget",
|
||||
"count": 4,
|
||||
"chance": 0.125
|
||||
},
|
||||
{
|
||||
"item": "minecraft:dead_bush",
|
||||
"count": 1,
|
||||
"chance": 0.05
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
16
src/main/resources/data/create/recipes/splashing/sand.json
Normal file
16
src/main/resources/data/create/recipes/splashing/sand.json
Normal file
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:sand"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:clay_ball",
|
||||
"count": 2
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:soul_sand"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:quartz",
|
||||
"count": 4,
|
||||
"chance": 0.125
|
||||
},
|
||||
{
|
||||
"item": "minecraft:gold_nugget",
|
||||
"count": 1,
|
||||
"chance": 0.02
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:white_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:white_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
"type": "create:splashing",
|
||||
"group": "minecraft:misc",
|
||||
"ingredients": [
|
||||
{
|
||||
"item": "minecraft:yellow_concrete_powder"
|
||||
}
|
||||
],
|
||||
"results": [
|
||||
{
|
||||
"item": "minecraft:yellow_concrete",
|
||||
"count": 1
|
||||
}
|
||||
],
|
||||
"processingTime": 100
|
||||
}
|
Loading…
Reference in a new issue