ServerSide links to ClientSideProxy

public interface IProxy{
public void getMap();
public void initProxy();
}

public class ClientProxy implements IProxy{

private Map mapClient;

@Override
public void initProxy() {
mapClient = new HashMap<>();
}

@Override
public Map getMap() {
return mapClient;
}
}

public class ServerProxy implements IProxy{

private Map mapServer;

@Override
public void initProxy() {
mapServer = new HashMap<>();
}

@Override
public Map getMap() {
return mapServer;
}
}

@SidedProxy(clientSide = "mod.ClientProxy", serverSide = "mod.ServerProxy")
public static IProxy proxy;
public interface IProxy{
public void getMap();
public void initProxy();
}

public class ClientProxy implements IProxy{

private Map mapClient;

@Override
public void initProxy() {
mapClient = new HashMap<>();
}

@Override
public Map getMap() {
return mapClient;
}
}

public class ServerProxy implements IProxy{

private Map mapServer;

@Override
public void initProxy() {
mapServer = new HashMap<>();
}

@Override
public Map getMap() {
return mapServer;
}
}

@SidedProxy(clientSide = "mod.ClientProxy", serverSide = "mod.ServerProxy")
public static IProxy proxy;
if i do now proxy.getMap().clear() on the client the server map will be also cleared, idk why when printing proxy right after that i get mob.ClientProxy@16125bbc when printing proxy inside getMap() i get Server thread [mob.ClientProxy:56]: clientside_map and CLient thread [mob.ClientProxy:56]: clientside_map If i also do FMLCommonHandler.instance().getEffectiveSide() i get Side.Server when im in the ClientProxy class. Idk what todo now
3 Replies
JavaBot
JavaBot•3y ago
Hey, @Verse! Please remember to /close this post once your question has been answered!
JavaBot
JavaBot•3y ago
@help-ping
Requested by Jonosa#1242
JavaBot
JavaBot•3y ago
💤 Post marked as dormant
This post has been inactive for over 300 minutes, thus, it has been archived. If your question was not answered yet, feel free to re-open this post or create a new one.

Did you find this page helpful?