Skip to content

Commit

Permalink
v2.0.4
Browse files Browse the repository at this point in the history
  • Loading branch information
RuochenFu21 committed Aug 4, 2023
1 parent 0a59e63 commit b841158
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ out/

# Visual Studio Code
.history/
Icon*
Icon*
!icon.png
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ org.gradle.jvmargs=-Xmx3G
org.gradle.daemon=false
mc_version=1.18.2

mod_version = 2.0.2
mod_version = 2.0.4

create_version = 0.5.+
flywheel_version = 0.6.+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,19 +42,27 @@ public List<BlockPos> addPropagationLocations(IRotate block, BlockState state, L
public List<KineticBlockEntity> getConnectedTransmitters(){
Map<String, List<KineticBlockEntity>> channel = EnergyNetwork.ENERGY.channels.get(getChannel());

channel.values().removeIf(List::isEmpty);

channel.forEach((password, transmitters) -> transmitters.removeIf(blockEntity ->
!(blockEntity instanceof EnergyTransmitterBlockEntity transmitter)
||
transmitter.getChannel() != getChannel() || !transmitter.getPassword().equals(password)
));

channel.values().forEach(list -> list.removeIf(BlockEntity::isRemoved));

if (channel.containsKey(getPassword())) {
List<KineticBlockEntity> list = channel
.get(getPassword());

if(!list.contains(this))
list.add(this);

return list;
}

channel.values().removeIf(List::isEmpty);

channel.values().forEach(list -> list.removeIf(BlockEntity::isRemoved));
return list;
}

ArrayList<KineticBlockEntity> list = new ArrayList<>(List.of(this));

Expand All @@ -72,17 +80,16 @@ public void reloadSettings(){

if (level == null) return;

if (hasNetwork())
getOrCreateNetwork().remove(this);
detachKinetics();
removeSource();
}

@Override
public void afterReload(){
if (level == null) return;

if (hasNetwork())
getOrCreateNetwork().remove(this);
removeSource();
detachKinetics();
attachKinetics();
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b841158

Please sign in to comment.