mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2025-07-22 04:03:13 +00:00
fix
This commit is contained in:
parent
ea3e7f9ace
commit
7863660a47
91
pom.xml
91
pom.xml
@ -15,40 +15,44 @@
|
||||
<development.location.dan>${user.home}\Documents\development\server\plugins\${project.name}.jar</development.location.dan>
|
||||
<lint.in>${project.basedir}\lint\in.jar</lint.in>
|
||||
</properties>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.txt</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.json</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>false</minimizeJar>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>dan</id>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.txt</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.json</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>true</minimizeJar>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
@ -77,36 +81,7 @@
|
||||
<profile>
|
||||
<id>release</id>
|
||||
<build>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
<filtering>true</filtering>
|
||||
<includes>
|
||||
<include>**/*.xml</include>
|
||||
<include>**/*.yml</include>
|
||||
<include>**/*.txt</include>
|
||||
<include>**/*.properties</include>
|
||||
<include>**/*.html</include>
|
||||
</includes>
|
||||
</resource>
|
||||
</resources>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
<configuration>
|
||||
<minimizeJar>false</minimizeJar>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.codehaus.mojo</groupId>
|
||||
<artifactId>exec-maven-plugin</artifactId>
|
||||
|
@ -24,7 +24,7 @@ public class CommandIrisGoto extends MortarCommand
|
||||
@Override
|
||||
public boolean handle(MortarSender sender, String[] args)
|
||||
{
|
||||
if(args.length <= 1)
|
||||
if(args.length < 1)
|
||||
{
|
||||
sender.sendMessage("/iris world goto " + getArgsUsage());
|
||||
return true;
|
||||
|
@ -26,7 +26,7 @@ public class CommandIrisMetrics extends MortarCommand
|
||||
{
|
||||
if(sender.isPlayer())
|
||||
{
|
||||
Player p = (Player) sender;
|
||||
Player p = sender.player();
|
||||
World world = p.getWorld();
|
||||
IrisChunkGenerator g = (IrisChunkGenerator) world.getGenerator();
|
||||
IrisMetrics m = g.getMetrics();
|
||||
|
@ -79,17 +79,17 @@ public class CommandIrisStudioCreate extends MortarCommand
|
||||
b1.setMin(3);
|
||||
b1.setMax(7);
|
||||
IrisBiomeGeneratorLink b2 = new IrisBiomeGeneratorLink();
|
||||
b1.setGenerator(gen.getLoadKey());
|
||||
b1.setMin(12);
|
||||
b1.setMax(35);
|
||||
b2.setGenerator(gen.getLoadKey());
|
||||
b2.setMin(12);
|
||||
b2.setMax(35);
|
||||
IrisBiomeGeneratorLink b3 = new IrisBiomeGeneratorLink();
|
||||
b1.setGenerator(gen.getLoadKey());
|
||||
b1.setMin(-1);
|
||||
b1.setMax(1);
|
||||
b3.setGenerator(gen.getLoadKey());
|
||||
b3.setMin(-1);
|
||||
b3.setMax(1);
|
||||
IrisBiomeGeneratorLink b4 = new IrisBiomeGeneratorLink();
|
||||
b1.setGenerator(gen.getLoadKey());
|
||||
b1.setMin(-5);
|
||||
b1.setMax(-38);
|
||||
b4.setGenerator(gen.getLoadKey());
|
||||
b4.setMin(-5);
|
||||
b4.setMax(-38);
|
||||
exampleLand2.getLayers().get(0).getPalette().clear();
|
||||
exampleLand2.getLayers().get(0).getPalette().add("RED_SAND");
|
||||
exampleShore1.getLayers().get(0).getPalette().clear();
|
||||
|
@ -25,7 +25,8 @@ public class CommandIrisWhatBlock extends MortarCommand
|
||||
{
|
||||
if(sender.isPlayer())
|
||||
{
|
||||
BlockData bd = ((Player) sender).getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
|
||||
Player p = sender.player();
|
||||
BlockData bd = p.getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
|
||||
sender.sendMessage("Material: " + ChatColor.GREEN + bd.getMaterial().name());
|
||||
sender.sendMessage("Full: " + ChatColor.WHITE + bd.getAsString(true));
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package com.volmit.iris.command;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.FluidCollisionMode;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
@ -9,10 +8,8 @@ import com.volmit.iris.Iris;
|
||||
import com.volmit.iris.util.MortarCommand;
|
||||
import com.volmit.iris.util.MortarSender;
|
||||
|
||||
public class CommandIrisWhatHand extends MortarCommand
|
||||
{
|
||||
public CommandIrisWhatHand()
|
||||
{
|
||||
public class CommandIrisWhatHand extends MortarCommand {
|
||||
public CommandIrisWhatHand() {
|
||||
super("hand", "h");
|
||||
setDescription("Get the block data for holding.");
|
||||
requiresPermission(Iris.perm.studio);
|
||||
@ -25,7 +22,8 @@ public class CommandIrisWhatHand extends MortarCommand
|
||||
{
|
||||
if(sender.isPlayer())
|
||||
{
|
||||
BlockData bd = ((Player) sender).getTargetBlockExact(128, FluidCollisionMode.NEVER).getBlockData();
|
||||
Player p = sender.player();
|
||||
BlockData bd = p.getInventory().getItemInMainHand().getType().createBlockData();
|
||||
sender.sendMessage("Material: " + ChatColor.GREEN + bd.getMaterial().name());
|
||||
sender.sendMessage("Full: " + ChatColor.WHITE + bd.getAsString(true));
|
||||
}
|
||||
@ -39,8 +37,7 @@ public class CommandIrisWhatHand extends MortarCommand
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getArgsUsage()
|
||||
{
|
||||
protected String getArgsUsage() {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ import org.bukkit.generator.ChunkGenerator.ChunkData;
|
||||
import com.volmit.iris.object.IrisBiome;
|
||||
import com.volmit.iris.util.BlockDataTools;
|
||||
import com.volmit.iris.util.HeightMap;
|
||||
import com.volmit.iris.util.KList;
|
||||
import com.volmit.iris.util.KMap;
|
||||
import com.volmit.iris.util.M;
|
||||
|
||||
@ -172,19 +173,18 @@ public class AtomicSliver
|
||||
lock.lock();
|
||||
this.block = new KMap<Integer, BlockData>();
|
||||
int h = din.readByte() - Byte.MIN_VALUE;
|
||||
int p = din.readByte() - Byte.MIN_VALUE;
|
||||
KList<BlockData> palette = new KList<BlockData>();
|
||||
highestBlock = h;
|
||||
|
||||
for(int i = 0; i < p; i++)
|
||||
{
|
||||
palette.add(BlockDataTools.getBlockData(din.readUTF()));
|
||||
}
|
||||
|
||||
for(int i = 0; i <= h; i++)
|
||||
{
|
||||
BlockData v = BlockDataTools.getBlockData(din.readUTF());
|
||||
|
||||
if(v == null)
|
||||
{
|
||||
block.put(i, AIR);
|
||||
continue;
|
||||
}
|
||||
|
||||
block.put(i, v);
|
||||
block.put(i, palette.get(din.readByte() - Byte.MIN_VALUE).clone());
|
||||
}
|
||||
modified = false;
|
||||
lock.unlock();
|
||||
@ -194,12 +194,33 @@ public class AtomicSliver
|
||||
{
|
||||
lock.lock();
|
||||
dos.writeByte(highestBlock + Byte.MIN_VALUE);
|
||||
KList<String> palette = new KList<>();
|
||||
|
||||
for(int i = 0; i <= highestBlock; i++)
|
||||
{
|
||||
BlockData dat = block.get(i);
|
||||
dos.writeUTF((dat == null ? AIR : dat).getAsString(true));
|
||||
String d = (dat == null ? AIR : dat).getAsString(true);
|
||||
|
||||
if(!palette.contains(d))
|
||||
{
|
||||
palette.add(d);
|
||||
}
|
||||
}
|
||||
|
||||
dos.writeByte(palette.size() + Byte.MIN_VALUE);
|
||||
|
||||
for(String i : palette)
|
||||
{
|
||||
dos.writeUTF(i);
|
||||
}
|
||||
|
||||
for(int i = 0; i <= highestBlock; i++)
|
||||
{
|
||||
BlockData dat = block.get(i);
|
||||
String d = (dat == null ? AIR : dat).getAsString(true);
|
||||
dos.writeByte(palette.indexOf(d) + Byte.MIN_VALUE);
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
}
|
||||
|
||||
|
@ -8,18 +8,19 @@ import com.volmit.iris.Iris;
|
||||
|
||||
public class BlockDataTools
|
||||
{
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
private static final KMap<String, BlockData> bdc = new KMap<>();
|
||||
private static final KList<String> nulls = new KList<>();
|
||||
|
||||
public static BlockData getBlockData(String bd)
|
||||
{try
|
||||
{
|
||||
if(bdc.containsKey(bd))
|
||||
{
|
||||
return bdc.get(bd).clone();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
BlockData bdx = parseBlockData(bd);
|
||||
|
||||
if(bdx == null)
|
||||
@ -39,7 +40,7 @@ public class BlockDataTools
|
||||
Iris.warn("Unknown Block Data '" + bd + "'");
|
||||
}
|
||||
|
||||
return null;
|
||||
return AIR;
|
||||
}
|
||||
|
||||
public static BlockData parseBlockData(String ix)
|
||||
@ -75,7 +76,7 @@ public class BlockDataTools
|
||||
|
||||
}
|
||||
|
||||
return null;
|
||||
return AIR;
|
||||
}
|
||||
|
||||
public static boolean isLit(BlockData mat)
|
||||
|
6
src/main/java/com/volmit/iris/util/Denv.java
Normal file
6
src/main/java/com/volmit/iris/util/Denv.java
Normal file
@ -0,0 +1,6 @@
|
||||
package com.volmit.iris.util;
|
||||
|
||||
public class Denv
|
||||
{
|
||||
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user