SPIGOT-5716: Clarify documentation of MultipleFacing

This commit is contained in:
md_5 2020-05-09 16:12:18 +10:00
parent 46a1386066
commit d07a78b1f3
10 changed files with 100 additions and 20 deletions

View file

@ -10,12 +10,20 @@ public abstract class CraftMultipleFacing extends CraftBlockData implements Mult
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftChorusFruit extends org.bukkit.craftbukkit.block.data.Cr
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftCobbleWall extends org.bukkit.craftbukkit.block.data.Cra
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftFence extends org.bukkit.craftbukkit.block.data.CraftBlo
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -40,12 +40,20 @@ public final class CraftFire extends org.bukkit.craftbukkit.block.data.CraftBloc
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftHugeMushroom extends org.bukkit.craftbukkit.block.data.C
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftIronBars extends org.bukkit.craftbukkit.block.data.Craft
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftStainedGlassPane extends org.bukkit.craftbukkit.block.da
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -49,12 +49,20 @@ public final class CraftTripwire extends org.bukkit.craftbukkit.block.data.Craft
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override

View file

@ -21,12 +21,20 @@ public final class CraftVine extends org.bukkit.craftbukkit.block.data.CraftBloc
@Override @Override
public boolean hasFace(org.bukkit.block.BlockFace face) { public boolean hasFace(org.bukkit.block.BlockFace face) {
return get(FACES[face.ordinal()]); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
return get(state);
} }
@Override @Override
public void setFace(org.bukkit.block.BlockFace face, boolean has) { public void setFace(org.bukkit.block.BlockFace face, boolean has) {
set(FACES[face.ordinal()], has); net.minecraft.server.BlockStateBoolean state = FACES[face.ordinal()];
if (state == null) {
throw new IllegalArgumentException("Non-allowed face " + face + ". Check MultipleFacing.getAllowedFaces.");
}
set(state, has);
} }
@Override @Override