Skip to content

Commit

Permalink
Package name changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Fedin committed Nov 29, 2016
1 parent 3c746b3 commit 7d9d833
Show file tree
Hide file tree
Showing 13 changed files with 42 additions and 44 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.exception;
package mregioneer.exception;

public class EmptySection extends Exception {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;


import ru.wpstuio.amorphine.utils.Coordinates3d;
import mregioneer.utils.Coordinates3d;

public class Block {
private final int x;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;


import com.mojang.nbt.ByteArrayTag;
import com.mojang.nbt.CompoundTag;
import com.mojang.nbt.IntTag;
import com.mojang.nbt.ListTag;
import ru.wpstuio.amorphine.utils.Coordinates2d;
import ru.wpstuio.amorphine.utils.Coordinates3d;

import static ru.wpstuio.amorphine.utils.Formulae.localBlockFromBlock;
import static ru.wpstuio.amorphine.utils.Formulae.sectionFromBlock;
import mregioneer.utils.Coordinates2d;
import mregioneer.utils.Coordinates3d;
import mregioneer.utils.Formulae;


public class Chunk {
Expand Down Expand Up @@ -89,13 +87,13 @@ public Section getSection(byte index) {
*/
public void changeBlockId(int x, int y, int z, byte id) {

int local_x = localBlockFromBlock(x);
int local_y = localBlockFromBlock(y);
int local_z = localBlockFromBlock(z);
int local_x = Formulae.localBlockFromBlock(x);
int local_y = Formulae.localBlockFromBlock(y);
int local_z = Formulae.localBlockFromBlock(z);

int offset = local_y * 16 * 16 + local_z * 16 + local_x;

byte section_index = (byte) sectionFromBlock(y);
byte section_index = (byte) Formulae.sectionFromBlock(y);
Section section = getSection(section_index);

ByteArrayTag block_bytes_tag = (ByteArrayTag) section.get("Blocks");
Expand All @@ -109,13 +107,13 @@ public void changeBlockId(int x, int y, int z, byte id) {
* @param id
*/
public void changeBlockId(Coordinates3d cords, byte id) {
int local_x = localBlockFromBlock(cords.getX());
int local_y = localBlockFromBlock(cords.getY());
int local_z = localBlockFromBlock(cords.getZ());
int local_x = Formulae.localBlockFromBlock(cords.getX());
int local_y = Formulae.localBlockFromBlock(cords.getY());
int local_z = Formulae.localBlockFromBlock(cords.getZ());

int offset = local_y * 16 * 16 + local_z * 16 + local_x;

byte section_index = (byte) sectionFromBlock(cords.getY());
byte section_index = (byte) Formulae.sectionFromBlock(cords.getY());
Section section = getSection(section_index);

ByteArrayTag block_bytes_tag = (ByteArrayTag) section.get("Blocks");
Expand All @@ -131,11 +129,11 @@ public void changeBlockId(Coordinates3d cords, byte id) {
* @return byte of the basic id of the block
*/
public byte getBlockId(int x, int y, int z) {
int local_x = localBlockFromBlock(x);
int local_y = localBlockFromBlock(y);
int local_z = localBlockFromBlock(z);
int local_x = Formulae.localBlockFromBlock(x);
int local_y = Formulae.localBlockFromBlock(y);
int local_z = Formulae.localBlockFromBlock(z);

int section_index = sectionFromBlock(y);
int section_index = Formulae.sectionFromBlock(y);

int offset = local_y * 16 * 16 + local_z * 16 + local_x;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;


import com.mojang.nbt.CompoundTag;
import com.mojang.nbt.NbtIo;
import mregioneer.utils.Coordinates3d;
import net.minecraft.world.level.chunk.storage.RegionFile;
import ru.wpstuio.amorphine.utils.Coordinates2d;
import ru.wpstuio.amorphine.utils.Coordinates3d;
import ru.wpstuio.amorphine.utils.Formulae;
import mregioneer.utils.Coordinates2d;
import mregioneer.utils.Formulae;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

import static ru.wpstuio.amorphine.utils.Formulae.localChunkFromBlock;
import static mregioneer.utils.Formulae.localChunkFromBlock;

public class Region {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;

import com.mojang.nbt.ByteArrayTag;
import com.mojang.nbt.ByteTag;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;

import com.flowpowered.nbt.CompoundTag;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package ru.wpstuio.amorphine.mcaliases;
package mregioneer.mcaliases;

import com.googlecode.concurrentlinkedhashmap.ConcurrentLinkedHashMap;
import mregioneer.utils.Coordinates3d;
import net.minecraft.world.level.chunk.storage.RegionFile;
import ru.wpstuio.amorphine.utils.Coordinates2d;
import ru.wpstuio.amorphine.utils.Coordinates3d;
import mregioneer.utils.Coordinates2d;

import java.io.File;
import java.io.IOException;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentMap;

import static ru.wpstuio.amorphine.utils.Formulae.regionFromBlock;
import static mregioneer.utils.Formulae.regionFromBlock;


public class World {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.utils;
package mregioneer.utils;

/**
* The class has been created to use as a key for hash maps containing chunks, regions and so on.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.utils;
package mregioneer.utils;

/**
* The class has been created to use as a key for hash maps containing chunks, regions and so on.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.utils;
package mregioneer.utils;

/**
* Created by amorphine on 20.11.16.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package ru.wpstuio.amorphine.utils;
package mregioneer.utils;

/**
* Created by amorphine on 23.11.16.
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/TestReadWrite.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

import org.ini4j.Ini;
import org.junit.Test;
import ru.wpstuio.amorphine.mcaliases.Chunk;
import ru.wpstuio.amorphine.mcaliases.Region;
import ru.wpstuio.amorphine.mcaliases.World;
import ru.wpstuio.amorphine.utils.Coordinates2d;
import mregioneer.mcaliases.Chunk;
import mregioneer.mcaliases.Region;
import mregioneer.mcaliases.World;
import mregioneer.utils.Coordinates2d;

import java.io.File;
import java.io.IOException;
Expand Down
8 changes: 4 additions & 4 deletions src/test/java/TestReadWrite2.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.ini4j.Ini;
import org.junit.Test;
import ru.wpstuio.amorphine.mcaliases.World;
import ru.wpstuio.amorphine.utils.Coordinates3d;
import mregioneer.mcaliases.World;
import mregioneer.utils.Coordinates3d;

import java.io.File;
import java.io.IOException;
Expand All @@ -14,7 +14,7 @@ public class TestReadWrite2 {
public void testAdd() {

World world;
byte id_to_make = 13;
byte id_to_make = 14;

try {
//initializing path to region folder
Expand All @@ -25,7 +25,7 @@ public void testAdd() {
world = new World(new File (path_to_mca_folder));

Coordinates3d cords;
for(int inty = 66; inty < 100; inty++){
for(int inty = 6; inty < 100; inty++){
for(int intz = -10; intz < 10; intz++){
for(int intx = -10; intx < 10; intx++){
world.changeBlockID(new Coordinates3d(intx, inty, intz), id_to_make);
Expand Down

0 comments on commit 7d9d833

Please sign in to comment.