Prototype commit 2

This commit is contained in:
Nadja Reitzenstein
2022-01-30 01:57:46 +01:00
committed by Kilobyte22
parent 40cfc418d6
commit 6b9b51f6c1
3 changed files with 8 additions and 4 deletions

View File

@@ -65,6 +65,7 @@ public final class VxlanBlockEntity extends ModBlockEntity implements NetworkInt
@Override
protected void onUnload(final boolean isRemove) {
adjacentBlockInterfaces[0] = null;
TunnelManager.instance().unregisterVti(vti);
super.onUnload(isRemove);
@@ -74,7 +75,8 @@ public final class VxlanBlockEntity extends ModBlockEntity implements NetworkInt
public void onLoad() {
super.onLoad();
TunnelManager.instance().registerVti(vti, this);
System.out.println("Tunnel VTI: " + vti);
adjacentBlockInterfaces[0] = TunnelManager.instance().registerVti(vti, this);
}
///////////////////////////////////////////////////////////////////

View File

@@ -93,8 +93,10 @@ public class TunnelManager {
DatagramPacket packet = new DatagramPacket(buffer, buffer.length, this.remoteHost, this.remotePort);
}
public void registerVti(int vti, NetworkInterface iface) {
tunnels.put(vti, new TunnelInterface(vti, iface));
public NetworkInterface registerVti(int vti, NetworkInterface iface) {
TunnelInterface tuniface = new TunnelInterface(vti, iface);
tunnels.put(vti, tuniface);
return tuniface;
}
public void unregisterVti(int vti) {

View File

@@ -17,7 +17,7 @@ This mod uses the Terminus Font under the Open Font License. The full license ca
[[dependencies.oc2]]
modId = "forge"
mandatory = true
versionRange = "[39.0.63,)"
versionRange = "[39.0.59,)"
ordering = "NONE"
side = "BOTH"
[[dependencies.oc2]]