Skip to content
This repository has been archived by the owner on Jan 26, 2019. It is now read-only.

Commit

Permalink
Testing for 'always replace these blocks with air'
Browse files Browse the repository at this point in the history
  • Loading branch information
robotia committed Mar 13, 2016
1 parent 82ad45d commit 185eef5
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,21 @@
public Block getBlockByExtId(int p_150819_1_, int p_150819_2_, int p_150819_3_)
{
int l = this.blockLSBArray[p_150819_2_ << 8 | p_150819_3_ << 4 | p_150819_1_] & 255;
@@ -139,6 +162,106 @@
@@ -39,7 +62,12 @@
{
l |= this.blockMSBArray.get(p_150819_1_, p_150819_2_, p_150819_3_) << 8;
}
-
+
+ for(int IDTOBAN : net.minecraftforge.cauldron.configuration.CauldronConfig.instance.instantRemove.getValue())
+ {
+ if ( l == IDTOBAN) return Blocks.air;
+ }
+
return Block.getBlockById(l);
}

@@ -139,6 +167,106 @@

public void removeInvalidBlocks()
{
Expand Down Expand Up @@ -137,7 +151,7 @@
this.blockRefCount = 0;
this.tickRefCount = 0;

@@ -197,29 +320,72 @@
@@ -197,29 +325,72 @@

public void setBlockLSBArray(byte[] p_76664_1_)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public class CauldronConfig extends ConfigBase

// World Protection options
public final BoolSetting protectSP = new BoolSetting(this, "protection.spawn-protect", true, "Whether to enable Thermos' all-seeing protection in the spawn world");

public final IntArraySetting instantRemove = new IntArraySetting(this, "protection.instant-removal", new Integer[] {}, "Contains Block IDs that you want to NEVER exist in the world i.e. world anchors (just in case)");

// Plug-in options
public final BoolSetting reloadPlugins = new BoolSetting(this, "plugin-settings.allow-reload", false, "Allow plugins to be reloaded. WARNING - breaks with some mods. We *will not* support this!");

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package net.minecraftforge.cauldron.configuration;

import java.util.ArrayList;

public class IntArraySetting extends Setting<Integer[]> {
private Integer[] value;
private ConfigBase config;

public IntArraySetting(ConfigBase config, String path, Integer[] def, String description)
{
super(path, def, description);
this.value = def;
this.config = config;
}

@Override
public Integer[] getValue()
{
return value;
}

@Override
public void setValue(String value)
{
String[] vals = value.split(",");
ArrayList<Integer> minty = new ArrayList<Integer>(vals.length);
for(int i = 0; i < vals.length; i++)
{
try
{
minty.add(Integer.parseInt(vals[i]));
}
catch(Exception e)
{

}
catch(Error eeek)
{

}
}
this.value = new Integer[minty.size()];
for(int i = 0; i < this.value.length; i++)
{
this.value[i] = minty.get(i);
}
config.set(path, this.value);
}
}

0 comments on commit 185eef5

Please sign in to comment.