Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package net.mcreator.vanillaaddons.procedures;
- import net.minecraft.world.IWorld;
- import net.mcreator.vanillaaddons.VanillaaddonsModVariables;
- import net.mcreator.vanillaaddons.VanillaaddonsModElements;
- import java.util.Map;
- import java.io.IOException;
- import java.io.FileWriter;
- import java.io.FileReader;
- import java.io.FileNotFoundException;
- import java.io.File;
- import java.io.BufferedWriter;
- import java.io.BufferedReader;
- @VanillaaddonsModElements.ModElement.Tag
- public class ConfigFileReaderProcedure extends VanillaaddonsModElements.ModElement {
- public ConfigFileReaderProcedure(VanillaaddonsModElements instance) {
- super(instance, 79);
- }
- public static void executeProcedure(Map<String, Object> dependencies){
- if(dependencies.get("world") == null){
- System.err.println("Failed to load dependency world for procedure ConfigFileReader!");
- return;
- }
- IWorld world = (IWorld) dependencies.get("world");
- if (( (VanillaaddonsModVariables.WorldVariables.get(world).FirtsLoad)
- ==(true))) {if ((true)) {File ConfigFile = new File("//config/RaisminMod/" + "/" + "VanillaAddons.cfg");
- try {
- FileWriter ConfigFilewriter = new FileWriter(ConfigFile);
- BufferedWriter ConfigFilebw = new BufferedWriter(ConfigFilewriter);
- ConfigFilebw.write("# Configuration file");
- ConfigFilebw.newLine();
- ConfigFilebw.write("");
- ConfigFilebw.newLine();
- ConfigFilebw.write();
- ConfigFilebw.newLine();
- ConfigFilebw.write("#Version mod:0.0.0001");
- ConfigFilebw.newLine();
- ConfigFilebw.write("");
- ConfigFilebw.newLine();
- ConfigFilebw.write("Modules {");
- ConfigFilebw.newLine();
- ConfigFilebw.write("");
- ConfigFilebw.close();
- ConfigFilewriter.close();
- } catch (FileNotFoundException fileNotFoundException) {
- fileNotFoundException.printStackTrace();
- } catch (IOException exception) {
- exception.printStackTrace();
- }
- ConfigFilebw.write((("#If the magma block should become lava")+""+("[Default = true]")));
- ConfigFilebw.close();
- ConfigFilewriter.close();
- } catch (FileNotFoundException fileNotFoundException) {
- fileNotFoundException.printStackTrace();
- } catch (IOException exception) {
- exception.printStackTrace();
- }
- ConfigFilebw.write((("B:")+""+("ShouldMagmaHeat=")+""+("true")));
- ConfigFilebw.close();
- ConfigFilewriter.close();
- } catch (FileNotFoundException fileNotFoundException) {
- fileNotFoundException.printStackTrace();
- } catch (IOException exception) {
- exception.printStackTrace();
- }
- ConfigFilebw.write("");
- ConfigFilebw.close();
- ConfigFilewriter.close();
- }catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write((("#how many adjacent lava are needed to heat up")+""+("[Default = 2]")));ConfigFilebw.close();ConfigFilewriter.close();}catch(FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write((("I:")+""+("LavaNeedHeatUp")+""+("2")));ConfigFilebw.close();ConfigFilewriter.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write("");ConfigFilebw.close();ConfigFilewriter.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write((("#if the gravel and pile should exist")+""+("[Default = true]")));ConfigFilebw.close();ConfigFilewriter.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write((("B:")+""+("GravelSandPile = ")+""+("true")));ConfigFilebw.close();ConfigFilewriter.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }ConfigFilebw.write("}");ConfigFilebw.newLine();ConfigFilebw.write("");ConfigFilebw.close();ConfigFilewriter.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }VanillaaddonsModVariables.WorldVariables.get(world).FirtsLoad=(boolean)(false);VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);}}else{File ConfigFile = new File("//config/RaisminMod/" + "/" + "VanillaAddons.cfg");try
- {
- final BufferedReader ConfigFileReader = new BufferedReader(new FileReader(ConfigFile));
- String ConfigFileReadLine = null;
- ConfigFileReadLine = ConfigFileReader.readLine();
- if ((!(((ConfigFileReadLine)
- ).equals("# Configuration file")))) {ConfigFilebw.write("# Configuration file");
- ConfigFilebw.newLine();
- }ConfigFileReadLine = ConfigFileReader.readLine();
- if ((!(((ConfigFileReadLine)
- ).equals("")))) {ConfigFilebw.write("");
- ConfigFilebw.newLine();
- }ConfigFileReadLine = ConfigFileReader.readLine();
- if ((!(((ConfigFileReadLine)
- ).equals()))) {ConfigFilebw.write();
- ConfigFilebw.newLine();
- }ConfigFileReadLine = ConfigFileReader.readLine();
- if ((!(((ConfigFileReadLine)
- ).equals()))) {ConfigFilebw.write();
- ConfigFilebw.newLine();
- }ConfigFileReadLine = ConfigFileReader.readLine();
- ConfigFileReadLine = ConfigFileReader.readLine();
- ConfigFileReadLine = ConfigFileReader.readLine();
- ConfigFileReadLine = ConfigFileReader.readLine();
- ConfigFileReadLine = ConfigFileReader.readLine();
- if ((!(((((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("true"))))||(((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("false")))))||((((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("1"))))||(((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("0")))))))) {ConfigFilebw.write((("B:")+""+("ShouldMagmaHeat=")+""+("true")));
- ConfigFilebw.newLine();
- VanillaaddonsModVariables.WorldVariables.get(world).ShoulMagmaHeat =(boolean)(true);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }else{if (((((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("true"))))||(((ConfigFileReadLine)
- ).equals((("B:")+""+("ShouldMagmaHeat=")+""+("1")))))) { VanillaaddonsModVariables.WorldVariables.get(world).ShoulMagmaHeat =(boolean)(true);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }else{ VanillaaddonsModVariables.WorldVariables.get(world).ShoulMagmaHeat =(boolean)(false);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }}ConfigFileReadLine = ConfigFileReader.readLine();
- ConfigFileReadLine = ConfigFileReader.readLine();
- if (((ConfigFileReadLine)
- .contains("LavaNeedHeatUp"))) { VanillaaddonsModVariables.WorldVariables.get(world).LavaNeedHeatup =(double)new Object() {int convert(String s) { try { return Integer.parseInt(s.trim()); } catch (Exception e) { }return 0; }}.convert();
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }else{ConfigFilebw.write((("I:")+""+("LavaNeedHeatUp")+""+("2")));
- ConfigFilebw.close();
- ConfigFilewriter.close();
- } catch (FileNotFoundException fileNotFoundException) {
- fileNotFoundException.printStackTrace();
- } catch (IOException exception) {
- exception.printStackTrace();
- }
- VanillaaddonsModVariables.WorldVariables.get(world).LavaNeedHeatup =(double)2;
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }ConfigFileReadLine=ConfigFileReader.readLine();ConfigFileReadLine=ConfigFileReader.readLine();if((!(((((ConfigFileReadLine)).equals((("B:")+""+("GravelSandPile=")+""+("true"))))||(((ConfigFileReadLine)).equals((("B:")+""+("GravelSandPile=")+""+("false")))))||((((ConfigFileReadLine)).equals((("B:")+""+("GravelSandPile=")+""+("1"))))||(((ConfigFileReadLine)).equals((("B:")+""+("GravelSandPile=")+""+("0"))))))))
- {ConfigFilebw.write((("B:")+""+("GravelSandPile")+""+("true")));
- ConfigFilebw.newLine();
- VanillaaddonsModVariables.WorldVariables.get(world).GravelSandPile =(boolean)(true);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }else{if (((((ConfigFileReadLine)
- ).equals((("B:")+""+("GravelSandPile")+""+("true"))))||(((ConfigFileReadLine)
- ).equals((("B:")+""+("GravelSandPile")+""+("1")))))) { VanillaaddonsModVariables.WorldVariables.get(world).GravelSandPile =(boolean)(true);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }else{ VanillaaddonsModVariables.WorldVariables.get(world).GravelSandPile =(boolean)(false);
- VanillaaddonsModVariables.WorldVariables.get(world).syncData(world);
- }}ConfigFileReader.close();}catch(
- FileNotFoundException fileNotFoundException)
- {
- fileNotFoundException.printStackTrace();
- }catch(
- IOException exception)
- {
- exception.printStackTrace();
- }
- }}}
Add Comment
Please, Sign In to add comment