example 2: is the code that I tried to create myself I didn't follow the instructions good enough I want you to fix it and more closely follow the instructions
package com.rspsi.tools;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.stream.Collector;
import java.util.stream.Collectors;
import org.apache.commons.lang3.tuple.MutablePair;
public class StepsBuilder {
private final Map steps;
public StepsBuilder() {
steps = new LinkedHashMap<>();
} //move notepad tooo this monitor
public static StepsBuilder create() {
return new StepsBuilder();
}
public static void buildStairs() {
}
public StepsBuilder with(String key, Object value) {
steps.put(key, value);
return this;
}
public Map build() {
return steps;
}
public static Collector, ?, Map> toMap() {
return Collectors.toMap(MutablePair::getKey, MutablePair::getValue);
}
public static MutablePair of(String key, Object value) {
return new MutablePair<>(key, value);
}
}
example 3: is the code in bridgebuilder.java the instructions mentioned
package com.rspsi.tools;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import org.major.map.RenderFlags;
import com.jagex.Client;
import com.jagex.Client.LoadState;
import com.jagex.map.tile.SceneTile;
import com.jagex.util.BitFlag;
import com.rspsi.options.Options;
public class BridgeBuilder {
public static void buildBridge() throws Exception {
Client client = Client.getSingleton();
if(client.loadState == LoadState.ACTIVE) {
if(Options.currentHeight.get() == 3) {
throw new Exception("Invalid height");
}
int oldHeight = Options.tileHeightLevel.get();
BitFlag oldFlag = Options.tileFlags.get();
int lowerZ = Options.currentHeight.get();
List selectedTiles = client.sceneGraph.getSelectedTiles();
List tilesAbove = selectedTiles.stream().map(tile -> client.sceneGraph.tiles[tile.plane + 1][tile.positionX][tile.positionY]).collect(Collectors.toList());
List tilesAround = tilesAbove
.stream()
.flatMap(tile -> IntStream
.rangeClosed(-1, 1)
.boxed()
.flatMap(x -> IntStream.rangeClosed(-1, 1).mapToObj(y -> client.sceneGraph.tiles[tile.plane][tile.positionX + x][tile.positionY + y])))
.filter(tile -> !tilesAbove.contains(tile))
.collect(Collectors.toList());
int highestHeight = selectedTiles.stream().mapToInt(tile -> -client.mapRegion.tileHeights[lowerZ][tile.positionX][tile.positionY]).max().getAsInt();
BitFlag bridgeFlag = new BitFlag();
bridgeFlag.flag(RenderFlags.BRIDGE_TILE);
Options.tileHeightLevel.set(highestHeight);
Options.tileFlags.set(bridgeFlag);
Options.overlayPaintShapeId.set(1);
Options.overlayPaintId.set(1);
System.out.println(tilesAround.size());
System.out.println("Setting abs values to " + Options.tileHeightLevel.get());
client.sceneGraph.setTileFlags(tilesAbove);
client.sceneGraph.setTileHeights(tilesAbove, true);
client.sceneGraph.setTileHeights(tilesAround, true);
client.sceneGraph.setTileOverlays(tilesAbove);