Skip to content

Commit

Permalink
revert: Backport fluid conduit buff and some other fixes.
Browse files Browse the repository at this point in the history
This reverts commit 677f77d.
  • Loading branch information
Rover656 committed Oct 3, 2024
1 parent 6b23651 commit ff4879b
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 154 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,15 +280,6 @@ public TextureAtlasSprite getParticleIcon() {
return EIOModel.getMissingTexture();
}

@Override
public TextureAtlasSprite getParticleIcon(ModelData data) {
ConduitBundle conduitBundle = data.get(ConduitBlockEntity.BUNDLE_MODEL_PROPERTY); //default particle
if (conduitBundle == null) {
return EIOModel.getMissingTexture();
}
return sprite(conduitBundle, conduitBundle.getTypes().get(0));
}

@Override
public ItemOverrides getOverrides() {
return ItemOverrides.EMPTY;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class ConduitShape {
private final Map<ConduitType<?>, VoxelShape> conduitShapes = new HashMap<>();
private final Map<Direction, VoxelShape> directionShapes = new HashMap<>();
private static final VoxelShape CONNECTOR = Block.box(2.5f, 2.5, 15f, 13.5f, 13.5f, 16f);
public static final VoxelShape CONNECTION = Block.box(6.5f, 6.5f, 9.5, 9.5f, 9.5f, 16);
private static final VoxelShape CONNECTION = Block.box(6.5f, 6.5f, 9.5, 9.5f, 9.5f, 16);
private static final VoxelShape CORE = Block.box(6.5f, 6.5f, 6.5f, 9.5f, 9.5f, 9.5f);
private VoxelShape totalShape = CORE;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ public <T extends ConduitData<T>> RightClickAction addType(Level level, ConduitT
types.set(index, type);

var prevNode = (ConduitGraphObject<T>) nodes.remove(first.get());
nodes.put(type, node);

if (prevNode != null) {
node = new ConduitGraphObject<>(pos, prevNode.getConduitData()); //new node with old data
prevNode.getConduitData().onRemoved(type, level, pos);
if (!level.isClientSide() && prevNode.getGraph() != null) {
prevNode.getGraph().remove(prevNode);
}
}

nodes.put(type, node);
node.getConduitData().onCreated(type, level, pos, player);
connections.values().forEach(connection -> connection.disconnectType(index));
onChanged();

return new RightClickAction.Upgrade(first.get());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ public Graph<Mergeable.Dummy> getGraph() {
}

@Override
public void setGraph(@Nullable Graph<Mergeable.Dummy> graph) {
public void setGraph(Graph<Mergeable.Dummy> graph) {
this.graph = graph;
this.wrappedGraph = graph == null ? null : new WrappedConduitGraph<>(graph);
this.wrappedGraph = new WrappedConduitGraph<>(graph);
}

@Nullable
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -453,14 +453,11 @@ public boolean onDestroyedByPlayer(BlockState state, Level level, BlockPos pos,
}
return true;
}

SoundType soundtype = state.getSoundType(level, pos, player);
level.playSound(player, pos, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);

if (conduit.removeType(conduitType, !player.getAbilities().instabuild)) {
return super.onDestroyedByPlayer(state, level, pos, player, willHarvest, fluid);
}

SoundType soundtype = state.getSoundType(level, pos, player);
level.playSound(player, pos, soundtype.getBreakSound(), SoundSource.BLOCKS, (soundtype.getVolume() + 1.0F) / 2.0F, soundtype.getPitch() * 0.8F);
level.gameEvent(GameEvent.BLOCK_DESTROY, pos, GameEvent.Context.of(player, state));
return false;
}
Expand Down Expand Up @@ -503,9 +500,4 @@ private int getSignalOutput(DynamicConnectionState dyn, RedstoneConduitData data
// endregion

private record OpenInformation(Direction direction, ConduitType<?> type) {}

@Override
protected void spawnDestroyParticles(Level level, Player player, BlockPos pos, BlockState state) {

}
}
Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
package com.enderio.conduits.common.conduit.block;

import com.enderio.api.UseOnly;
import com.enderio.api.conduit.ConduitData;
import com.enderio.api.conduit.ConduitMenuData;
import com.enderio.api.conduit.ConduitType;
import com.enderio.api.conduit.ConduitData;
import com.enderio.api.conduit.SlotType;
import com.enderio.api.conduit.upgrade.ConduitUpgrade;
import com.enderio.api.filter.ResourceFilter;
import com.enderio.base.common.init.EIOCapabilities;
import com.enderio.conduits.ConduitNBTKeys;
import com.enderio.conduits.client.particle.ConduitBreakParticle;
import com.enderio.conduits.common.ConduitShape;
import com.enderio.conduits.common.conduit.ConduitBundle;
import com.enderio.conduits.common.conduit.ConduitBundleNetworkDataSlot;
import com.enderio.conduits.common.conduit.ConduitGraphObject;
import com.enderio.conduits.common.conduit.RightClickAction;
import com.enderio.conduits.common.conduit.SlotData;
import com.enderio.conduits.common.conduit.connection.ConnectionState;
import com.enderio.conduits.common.conduit.ConduitGraphObject;
import com.enderio.conduits.ConduitNBTKeys;
import com.enderio.conduits.common.ConduitShape;
import com.enderio.conduits.common.conduit.connection.DynamicConnectionState;
import com.enderio.conduits.common.conduit.connection.ConnectionState;
import com.enderio.conduits.common.conduit.connection.StaticConnectionStates;
import com.enderio.conduits.common.init.ConduitCapabilities;
import com.enderio.conduits.common.menu.ConduitMenu;
Expand Down Expand Up @@ -306,14 +305,8 @@ public <T extends ConduitData<T>> Optional<GraphObject<Mergeable.Dummy>> tryConn

return Optional.of(conduit.bundle.getNodeFor(type));
} else if (type.getTicker().canConnectTo(level, getBlockPos(), dir)) {
if (bundle.getConnectionState(dir, type) instanceof DynamicConnectionState) { //Already connected
updateConnectionToData(type);
return Optional.empty();
}
connectEnd(dir, type);
updateConnectionToData(type);
} else {
this.disconnect(dir, type);
}

return Optional.empty();
Expand Down Expand Up @@ -355,11 +348,6 @@ public boolean removeType(ConduitType<?> type, boolean shouldDrop) {
boolean shouldRemove = bundle.removeType(level, type);
removeNeighborConnections(type);
updateShape();

if (level.isClientSide) {
ConduitBreakParticle.addDestroyEffects(getBlockPos(), type);
}

return shouldRemove;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,13 @@ protected void tickCapabilityGraph(
toNextExtract:
for (CapabilityConnection extract: extracts) {
IItemHandler extractHandler = extract.capability;
int extracted = 0;

nextItem:
for (int i = 0; i < extractHandler.getSlots(); i++) {
int speed = 4;
if (extract.upgrade instanceof ExtractionSpeedUpgrade speedUpgrade) {
speed *= (int) Math.pow(2, speedUpgrade.tier());
}

ItemStack extractedItem = extractHandler.extractItem(i, speed - extracted, true);
ItemStack extractedItem = extractHandler.extractItem(i, speed, true);
if (extractedItem.isEmpty()) {
continue;
}
Expand Down Expand Up @@ -78,16 +75,11 @@ protected void tickCapabilityGraph(

ItemStack notInserted = ItemHandlerHelper.insertItem(insert.capability, extractedItem, false);
if (notInserted.getCount() < extractedItem.getCount()) {
extracted += extractedItem.getCount() - notInserted.getCount();
extractHandler.extractItem(i, extracted, false);
if (extracted >= speed) {
if (sidedExtractData.isRoundRobin) {
sidedExtractData.rotatingIndex = insertIndex + 1;
}
continue toNextExtract;
} else {
continue nextItem;
extractHandler.extractItem(i, extractedItem.getCount() - notInserted.getCount(), false);
if (sidedExtractData.isRoundRobin) {
sidedExtractData.rotatingIndex = insertIndex + 1;
}
continue toNextExtract;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ public static ConduitType<?> getById(int id) {
CONDUIT_TYPES.register("redstone_conduit", RedstoneConduitType::new);

public static final RegistryObject<FluidConduitType> FLUID =
fluidConduit("fluid_conduit", 100, false);
fluidConduit("fluid_conduit", 50, false);

public static final RegistryObject<FluidConduitType> FLUID2 =
fluidConduit("pressurized_fluid_conduit", 1_000, false);
fluidConduit("pressurized_fluid_conduit", 100, false);

public static final RegistryObject<FluidConduitType> FLUID3 =
fluidConduit("ender_fluid_conduit", 10_000, true);
fluidConduit("ender_fluid_conduit", 200, true);

public static final RegistryObject<ItemConduitType> ITEM =
CONDUIT_TYPES.register("item_conduit", ItemConduitType::new);
Expand Down

0 comments on commit ff4879b

Please sign in to comment.