}
}
-}
\ No newline at end of file
+}
super.setWorldData(seed, spawnX, spawnZ);
renderer.setWorldData(seed, spawnX, spawnZ);
}
-
-
}
import java.util.function.Function;
-public interface GetCache extends Function<Integer, BoundingBoxCache> { }
+public interface GetCache extends Function<Integer, BoundingBoxCache> {
+}
super.bind(input);
}
-
private int pressDuration = 0;
@Override
return cache;
}
- public void clear() {
+ void clear() {
cache.clear();
}
}
public void addBoundingBox(BoundingBox key) {
+ if(isCached(key)) return;
+
Set<BoundingBox> boundingBoxes = new HashSet<>();
boundingBoxes.add(key);
addBoundingBoxes(key, boundingBoxes);
}
- public void removeBoundingBox(BoundingBox key) {
+ void removeBoundingBox(BoundingBox key) {
cache.remove(key);
}
}
private void serverWorldTick(WorldServer world) {
int dimensionId = world.dimension.getType().getId();
VillageProcessor villageProcessor = villageProcessors.get(dimensionId);
- if(villageProcessor == null) return;
+ if (villageProcessor == null) return;
villageProcessor.process(world.getVillageCollection());
}
}
protected void clearCaches() {
- for(VillageProcessor villageProcessor : villageProcessors.values()) {
+ for (VillageProcessor villageProcessor : villageProcessors.values()) {
villageProcessor.clear();
}
villageProcessors.clear();
void clear() {
villageCache.clear();
}
-}
\ No newline at end of file
+}
public class EndChunkProcessor extends ChunkProcessor {
public EndChunkProcessor(BoundingBoxCache boundingBoxCache) {
super(boundingBoxCache);
- supportedStructures.add(BoundingBoxType.EndCity);}
+ supportedStructures.add(BoundingBoxType.EndCity);
+ }
}
supportedStructures.add(BoundingBoxType.Igloo);
supportedStructures.add(BoundingBoxType.PillagerOutpost);
}
-
}
return config;
}
- public static void saveConfig()
- {
+ public static void saveConfig() {
Configuration config = new Configuration(new File(configDir, "BBOutlineReloaded.cfg"));
- for(Setting<?> setting : settings) {
+ for (Setting<?> setting : settings) {
config.put(setting);
}
config.save();
}
Map<String, Setting<?>> settings = settingsGroup.get(category);
Setting<?> setting = settings.get(settingName);
- if(setting == null && category != FALLBACK_CATEGORY)
+ if (setting == null && category != FALLBACK_CATEGORY)
setting = getFallbackSetting(settingName, settings);
- if(setting != null && setting.getType() != type) {
+ if (setting != null && setting.getType() != type) {
setting = null;
}
if (setting == null) {
private <T> char getType(T defaultValue) {
String[] typeNames = defaultValue.getClass().getName().split("[.]");
- return typeNames[typeNames.length-1].charAt(0);
+ return typeNames[typeNames.length - 1].charAt(0);
}
void put(Setting<?> setting) {
private void initGui(CallbackInfo ci) {
//shuffle middle buttons up by 12 px to make space
int top = this.height / 6 + 42;
- for(GuiButton button : buttons) {
+ for (GuiButton button : buttons) {
if (button.id != 200 && button.y >= top)
button.y -= 12;
}
}
}
- @Inject(method = "onDisconnect", at=@At("HEAD"))
+ @Inject(method = "onDisconnect", at = @At("HEAD"))
private void onDisconnect(CallbackInfo ci) {
EventBus.publish(new DisconnectedFromRemoteServer());
}
@Mixin(NetHandlerPlayClient.class)
public class MixinNetHandlerPlayClient {
- @Inject(method = "onDisconnect", at=@At("HEAD"))
+ @Inject(method = "onDisconnect", at = @At("HEAD"))
private void onDisconnect(CallbackInfo ci) {
EventBus.publish(new DisconnectedFromRemoteServer());
}
public class MixinPlayerList {
@Inject(method = "playerLoggedIn", at = @At("RETURN"))
private void playerLoggedIn(EntityPlayerMP player, CallbackInfo ci) {
- if(player.connection.netManager.getRemoteAddress() instanceof LocalAddress) return;
+ if (player.connection.netManager.getRemoteAddress() instanceof LocalAddress) return;
EventBus.publish(new PlayerLoggedIn(new ServerPlayer(player)));
}
@Mixin(WorldServer.class)
public class MixinWorldServer {
- @Inject(method = "tick", at=@At(value = "INVOKE", target = "Lnet/minecraft/village/VillageCollection;tick()V", shift = At.Shift.AFTER))
+ @Inject(method = "tick", at = @At(value = "INVOKE", target = "Lnet/minecraft/village/VillageCollection;tick()V", shift = At.Shift.AFTER))
private void afterVillageTick(CallbackInfo ci) {
- EventBus.publish(new ServerWorldTick((WorldServer)(Object)this));
+ EventBus.publish(new ServerWorldTick((WorldServer) (Object) this));
}
-
}
Method method = URLClassLoader.class
.getDeclaredMethod("addURL", URL.class);
method.setAccessible(true);
- // addURLHandle = MethodHandles.lookup().unreflect(method);
addURL = url -> method.invoke(ClassLoader.getSystemClassLoader(), url);
} catch (ReflectiveOperationException e) {
throw new AssertionError(e);
}
private static void addURLToClasspath(File file) throws MalformedURLException {
- //try {
- addURL.accept(file.toURI().toURL());
- //addURLHandle.invoke(ClassLoader.getSystemClassLoader(), file.toURI().toURL());
- //} catch (Throwable t) {
- // throw t instanceof RuntimeException ? (RuntimeException) t : new RuntimeException(t);
- // }
+ addURL.accept(file.toURI().toURL());
}
public static void run(String version, List<String> args) throws IOException {
return target;
}
-
}
}
void acceptThrows(T elem) throws Throwable;
-}
\ No newline at end of file
+}